From 2b93d66ea851248a4fabdc70630248b5ae034125 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 21 Apr 2010 15:22:51 +0200 Subject: [PATCH] new helper function trimFields() --- lib/ZOOM/IRSpy/Utils.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ZOOM/IRSpy/Utils.pm b/lib/ZOOM/IRSpy/Utils.pm index 868639b..4f2580c 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 fields +sub trimFields { + 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 -- 1.7.10.4