Skip Menu |

This queue is for tickets about the CHI-Driver-Memcached CPAN distribution.

Report information
The Basics
Id: 106778
Status: resolved
Priority: 0/
Queue: CHI-Driver-Memcached

People
Owner: Nobody in particular
Requestors: NHORNE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.16
Fixed in: (no value)



Subject: Why doesn't this work?
I'm sorry to bother you with what I am sure is a bug in my code or a failure in my understanding, rather than a problem with your code or documentation, but please would you tell me why this code fails? #!/usr/bin/env perl use strict; use warnings; use CHI; my $config; $config->{memory_cache}->{driver} = 'Memcached'; $config->{memory_cache}->{server} = '127.0.0.1'; my $cache = create_memory_cache({ config => $config, namespace => 'foo' }); $cache->set('xyzzy', 'plugh', '1 day'); die unless $cache->get('xyzzy'); sub create_memory_cache { my %args = (ref($_[0]) eq 'HASH') ? %{$_[0]} : @_; my $config = $args{'config'}; die 'config is not optional' unless($config); my $driver = $config->{memory_cache}->{driver}; my %chi_args = ( driver => $driver, namespace => $args{'namespace'} ); my @server; $server[0] = $config->{memory_cache}->{server}; if($config->{memory_cache}->{'port'}) { $server[0] = ':' . $config->{memory_cache}->{port}; } else { $server[0] .= ':11211'; } $chi_args{'server'} = \@server; return CHI->new(%chi_args); } TIA.
Subject: Re: [rt.cpan.org #106778] AutoReply: Why doesn't this work?
Date: Sun, 30 Aug 2015 14:54:07 -0400
To: bug-CHI-Driver-Memcached [...] rt.cpan.org
From: Nigel Horne <njh [...] bandsman.co.uk>
I think I have it. It’s ‘servers’ not ‘server’, which does make sense after all. -Nigel