From: Andreas Neiser Date: Tue, 20 May 2014 13:27:31 +0000 (+0200) Subject: Parse netaddr stricter in get.pl X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a8583e5723efa09f84e6f2086c286d0742029ff4;p=daqtools.git Parse netaddr stricter in get.pl --- diff --git a/xml-db/get.pl b/xml-db/get.pl index f4677bd..a5a39fb 100755 --- a/xml-db/get.pl +++ b/xml-db/get.pl @@ -94,9 +94,13 @@ foreach my $req (@request) { ############################### die "Entity $file not found.\n" unless(-e $file) ; - - if ($netaddr=~ m/0x([0-9a-fA-F]{4})/) {$netaddr = hex($1);} - elsif ($netaddr=~ m/([0-9]{1,5})/) {$netaddr = $1;} + + + # trim whitespace from netaddr + $netaddr =~ s/^\s+|\s+$//g; + + if ($netaddr=~ m/^0x([0-9a-fA-F]{4})$/) {$netaddr = hex($1);} + elsif ($netaddr=~ m/^([0-9]{1,5})$/) {$netaddr = $1;} else {die "Could not parse address $netaddr\n";}