X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FUtils.pm;h=5c01a7bd1a742139b875d3dbd53254738a2c0e94;hb=5ae5e44d1f3f4a95c100dfa2e5ae2973a2e09202;hp=868639b284618c9392ccab3784040497b92103c6;hpb=9d4080a34de173459de92addb712853190f66ceb;p=irspy-moved-to-github.git diff --git a/lib/ZOOM/IRSpy/Utils.pm b/lib/ZOOM/IRSpy/Utils.pm index 868639b..5c01a7b 100644 --- a/lib/ZOOM/IRSpy/Utils.pm +++ b/lib/ZOOM/IRSpy/Utils.pm @@ -104,6 +104,15 @@ sub isodate { $year+1900, $mon+1, $mday, $hour, $min, $sec); } +# strips whitespaces and start and ends of a field +sub trimField { + my $field = shift; + + $field =~ s/^\s+//; + $field =~ s/\s+$//; + + return $field; +} # I can't -- just can't, can't, can't -- believe that this function # isn't provided by one of the core XML modules. But the evidence all