Subject: | Patch fixes usage of undefined value in $pid |
Date: | Wed, 17 Feb 2010 13:03:08 +0100 |
To: | bug-cache-memcached [...] rt.cpan.org |
From: | Allard Hoeve <allard [...] byte.nl> |
Hi there,
The following patch fixes the usage of an undefined value in $pid in
Cache/Memcached.pm, when connecting to a socket.
--- lib/Cache/Memcached.pm.orig 2010-02-17 13:01:35.000828000 +0100
Show quoted text
> +++ lib/Cache/Memcached.pm 2010-02-17 12:50:58.000000000 +0100
> @@ -233,7 +233,7 @@
>
> my $now = time();
> my ($ip, $port) = $host =~ /(.*):(\d+)$/;
> - $ip =~ s/[\[\]]//g; # get rid of optional IPv6 brackets
> + $ip =~ s/[\[\]]//g if defined $ip; # get rid of optional IPv6 brackets
>
> return undef if
> $host_dead{$host} && $host_dead{$host} > $now;
>
Please apply.
Regards,
Allard