Cache::Memcached question

Joachim Bauernberger
Mon, 3 May 2004 12:37:25 +0200


How do you guys check if the connection to memcached was successful?
No matter what I put into $config_memcachedhost below and no matter if 
memcached is running, the following would always result in a defined $memd 
object returned. Also $@ is empty.

How do you trap errors in connection setup? 

sub init_memcached
    eval {
        $memd = new Cache::Memcached {
        'servers' =>  @config_memcachedhosts ,
        'debug' => $config_memcached_debug,
        'compress_threshold' => $config_compress_threshold,
    die localtime()." Error connecting ($!) Cache::Memcached: $@\n" if ($@ 
|| !defined ($memd));

Thanks & best regards,

Is there a cvs for this too? 
Brad wanted to do something like $memd->errstr() IIRC in future releases.

Thanks & Best regards,