more strict argument checks for Cache::Memcached->new
Tokuhiro Matsuno
tokuhirom at gmail.com
Tue May 8 01:47:08 UTC 2007
I think, Cache::Memcached->new(servers => ['127.0.0.1:11211']) makes
very difficult to detect bug.
Please add the more strict checks.
Index: lib/Cache/Memcached.pm
===================================================================
--- lib/Cache/Memcached.pm (revision 555)
+++ lib/Cache/Memcached.pm (working copy)
@@ -11,6 +11,7 @@
use warnings;
no strict 'refs';
+use Carp;
use Storable ();
use Socket qw( MSG_NOSIGNAL PF_INET PF_UNIX IPPROTO_TCP SOCK_STREAM );
use IO::Handle ();
@@ -65,6 +66,7 @@
$self = fields::new( $self ) unless ref $self;
my ($args) = @_;
+ croak "Cache::Memcached->new required hashref: $args" unless ref
$args eq "HASH";
$self->set_servers($args->{'servers'});
$self->{'debug'} = $args->{'debug'} || 0;
More information about the memcached
mailing list