X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUtil.pm;h=aad4696565e1a9e8a709572b8467432b9fa7d011;hb=1c5fa3a6ec9cc163aab24565948e1bcff7d607d9;hp=7be97ebf17a1972afb6c0c117c11c0ac91ebdc9a;hpb=19f68ea69f734f50b46fba21aab99315d5803e09;p=spider.git diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 7be97ebf..aad46965 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,16 @@ sub writefilestr $fh->close; } } + +# remove leading and trailing spaces from an input string +sub unpad +{ + my $s = shift; + $s =~ s/^\s+|\s+$//; + return $s; +} + + + + +