Subject: | Undefined subroutine &bytes::length called at ... libmemcached.pm line 126 |
Thanks for Cache::Memcached::libmemcached.
When running the tests with MEMCACHED_SERVER defined, for version
0.02000 I noticed the following failure:
1..3
ok 1 - use Cache::Memcached::libmemcached;
ok 2 - The object isa Cache::Memcached::libmemcached
Undefined subroutine &bytes::length called at
...Cache/Memcached/libmemcached.pm line 126.
# Looks like you planned 3 tests but only ran 2.
# Looks like your test died just after 2.
It's in _mk_callbacks
# Check if we need compression
if (HAVE_ZLIB && $self->{compress_enable} &&
$self->{compress_threshold}) {
# Find the byte length
my $length = bytes::length($_);
if ($length > $self->{compress_threshold}) {
my $tmp = Compress::Zlib::memGzip($_);
if (1 - bytes::length($tmp) / $length <
$self->{compress_savingsS}) {
$_ = $tmp;
$_[1] |= F_COMPRESS;
}
}
}
return ();
It looks like bytes is being brought in by versions of Compress::Zlib
that are greater than 1.42, I have 1.41.
I was just wondering if a:
use bytes length;
Might be required for users with a version of Compress::Zlib that is
less than 2.001 (adding this makes the test pass). Or if a min version
of Compress::Zlib should be required?
Thanks
Peter (Stig) Edwards