Subject: | small patch to fix issue with using UNIX domain sockets |
Date: | Thu, 19 Nov 2009 18:06:27 -0800 |
To: | bug-Cache-Memcached [...] rt.cpan.org |
From: | Sven Sjoberg <svens [...] svens.com> |
If no ip:port socket type is specified, and only a unix domain socket is
specified then one single stderr line is output due to an undefined
variable.
This is the short patch that fixes that stderr output issue:
-------------------------------------------------------------------------------------------------------------------------------
--- Memcached.pm 2009-11-19 17:37:06.000000000 -0800
+++ Memcached.pm.patched 2009-11-19 17:37:40.000000000 -0800
@@ -233,7 +233,10 @@
my $now = time();
my ($ip, $port) = $host =~ /(.*):(\d+)$/;
- $ip =~ s/[\[\]]//g; # get rid of optional IPv6 brackets
+
+ if ( defined($ip) ) {
+ $ip =~ s/[\[\]]//g; # get rid of optional IPv6 brackets
+ }
return undef if
$host_dead{$host} && $host_dead{$host} > $now;
----------------------------------------------------------------------------------------------------------------------------------
Thanks!
Sven