X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUtil.pm;h=9264d50501b05440e35c481e69f0e6d3c60807ef;hb=3f1c5ab45aa13e99da6bea0bfcc6d4434beb5871;hp=7be97ebf17a1972afb6c0c117c11c0ac91ebdc9a;hpb=19f68ea69f734f50b46fba21aab99315d5803e09;p=spider.git diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 7be97ebf..9264d505 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -16,7 +16,7 @@ require Exporter; @ISA = qw(Exporter); @EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf parray parraypairs shellregex readfilestr writefilestr - print_all_fields cltounix iscallsign + print_all_fields cltounix iscallsign unpad ); @month = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); @@ -279,3 +279,17 @@ sub writefilestr $fh->close; } } + +# remove leading and trailing spaces from an input string +sub unpad +{ + my $s = shift; + $s =~ s/\s+$//; + $s =~ s/^\s+//; + return $s; +} + + + + +