X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUtil.pm;h=aad4696565e1a9e8a709572b8467432b9fa7d011;hb=9995de8c1bfcb9ed980ab0ef12e4d66564c04105;hp=de9ea018677765c837c56cf847d9ee7917ec90d0;hpb=a57ea9d5501f6d319a8cbfff997bad077cc31010;p=spider.git diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index de9ea018..aad46965 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -12,13 +12,11 @@ use Date::Parse; use IO::File; use Data::Dumper; -use Carp; - 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); @@ -281,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; +} + + + + +