From: Mike Taylor Date: Tue, 6 Jul 2010 10:38:19 +0000 (+0100) Subject: Avoid undefined variable warning when no ZOOM options precede specified ID. X-Git-Tag: CPAN-v1.02~22 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=18fb57abfe6c3aa71788d4b2d4296b9f8a1843c0 Avoid undefined variable warning when no ZOOM options precede specified ID. --- diff --git a/lib/ZOOM/IRSpy/Utils.pm b/lib/ZOOM/IRSpy/Utils.pm index 089e8e7..475e9de 100644 --- a/lib/ZOOM/IRSpy/Utils.pm +++ b/lib/ZOOM/IRSpy/Utils.pm @@ -286,6 +286,7 @@ sub _irspy_identifier2target { if !defined $id; my($prefix, $protocol, $target) = ($id =~ /([^:]*,)?(.*?):(.*)/); + $prefix ||= ""; if (uc($protocol) eq "Z39.50" || uc($protocol) eq "TCP") { return "${prefix}tcp:$target"; } elsif (uc($protocol) eq "SRU") {