view release on metacpan or search on metacpan
sv_release_COW|||
sv_release_IVX|||
sv_replace|||
sv_report_used|||
sv_reset|||
sv_rvweaken||5.006000|
sv_setiv_mg|5.006000||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
sv_setpv_mg|5.006000||p
view all matches for this distribution
view release on metacpan or search on metacpan
RETVAL = newSV(0);
sv_setref_pv(RETVAL, "CORBA::ORB",
(void *) CORBA::ORB::_duplicate(pomni_orb));
sv_setsv(weakref, RETVAL);
sv_rvweaken(weakref);
}
}
OUTPUT:
RETVAL
view all matches for this distribution
view release on metacpan or search on metacpan
corpus/dists/B-C.changes view on Meta::CPAN
added more magic tests for shared vars - n,p,P magic: 39-43. 41 nyi
* t/modules.t: fix -t (run module tests), print header only on full test
* t/modules.pm: do not test core or deprecated modules, esp. do not download perl
Added is_subset.
* t/testm.sh: implement -k
* t/testc.sh, t/TESTS: add 44 for weaken import and magic_killbackrefs #72922
1.24 2010-02-15 rurban
* C.pm: Fixed off by one array access in magic array init (34)
- valgrind is your friend.
Fixed aelemfast padsv access crash (Text::Tabs on freebsd7)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Flatten/Tree.pm view on Meta::CPAN
package CPAN::Flatten::Tree;
use strict;
use warnings;
use utf8;
use Scalar::Util 'weaken';
sub new {
my $class = shift;
my %args = ref $_[0] ? %{$_[0]} : @_;
my $self = bless {
lib/CPAN/Flatten/Tree.pm view on Meta::CPAN
require Carp;
Carp::confess("node (@{[$node->uid]}) already has a parent");
}
push @{ $self->{_children} }, $node;
$node->{_parent} = $self;
weaken $node->{_parent};
$self;
}
sub is_child {
my ($self, $that) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
data/tiddlers.json view on Meta::CPAN
"text": "\"\"\"\no See also:\n- https://www.defectivebydesign.org\n\no What is the point of the ABeCeDarian para?\n- It comes first in the alphabetical list and that's a hint everybody should read it to find marvellous modules which might oth...
"title": "FAQ",
"modified": "20260330235648590"
},
{
"text": "\"\"\"\no See also:\n- DataTypes - For Data::OptList\n- ExceptionHandling\n- MathsLibraries - For e.g. bigint, bignum\n- ModuleBuilding - For e.g. Exporter::Lexical, Lexical::Import\n- NewOperators - For Syntax::Feature::QwComments\n...
"title": "FeaturesAndPragmas",
"modified": "20260320213617000",
"created": "20241015223904337"
},
{
data/tiddlers.json view on Meta::CPAN
"title": "HardwareStuff",
"modified": "20260331020331601"
},
{
"created": "20221227022248119",
"text": "\"\"\"\no See also:\n- ArrayHandling\n- ConstantStuff\n- DataTypes\n- DataTraversal\n- Hash::Util ships with Perl\n- [[HTTPHandling]]\n\n<pre>\nCode to test something hashy:\nperl -MHash::Util=lock_keys -e '%hash = map {; $_ => $_ } ...
"title": "HashHandling",
"modified": "20260331004427640"
},
{
"text": "\"\"\"\no ACME::2026:\n- Checklists for glorious 2026 goals\n- https://metacpan.org/dist/ACME-2026\n\no App::MineralUtils:\n- Utilities related to mineral supplements\n- https://metacpan.org/dist/App-MineralUtils\n\no Sah::SchemaBund...
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
" return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
" unless \$#_ > 0 or defined \$_[0]->{%s};\n",
weak_init =>
" return do {\n" .
" \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
" \$_[0]->{%s};\n" .
" } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
return_if_get =>
" return \$_[0]->{%s} unless \$#_ > 0;\n",
set =>
" \$_[0]->{%s} = \$_[1];\n",
weaken =>
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
sub_end =>
" return \$_[0]->{%s};\n}\n",
);
sub field {
inc/Spiffy.pm view on Meta::CPAN
local *paired_arguments = sub { (qw(-package -init)) };
Spiffy->parse_arguments(@_);
};
my ($field, $default) = @values;
$package = $args->{-package} if defined $args->{-package};
die "Cannot have a default for a weakened field ($field)"
if defined $default && $args->{-weak};
return if defined &{"${package}::$field"};
require Scalar::Util if $args->{-weak};
my $default_string =
( ref($default) eq 'ARRAY' and not @$default )
inc/Spiffy.pm view on Meta::CPAN
}
$code .= sprintf $code{set_default}, $field, $default_string, $field
if defined $default;
$code .= sprintf $code{return_if_get}, $field;
$code .= sprintf $code{set}, $field;
$code .= sprintf $code{weaken}, $field, $field
if $args->{-weak};
$code .= sprintf $code{sub_end}, $field;
my $sub = eval $code;
die $@ if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
" return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
" unless \$#_ > 0 or defined \$_[0]->{%s};\n",
weak_init =>
" return do {\n" .
" \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
" \$_[0]->{%s};\n" .
" } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
return_if_get =>
" return \$_[0]->{%s} unless \$#_ > 0;\n",
set =>
" \$_[0]->{%s} = \$_[1];\n",
weaken =>
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
sub_end =>
" return \$_[0]->{%s};\n}\n",
);
sub field {
inc/Spiffy.pm view on Meta::CPAN
local *paired_arguments = sub { (qw(-package -init)) };
Spiffy->parse_arguments(@_);
};
my ($field, $default) = @values;
$package = $args->{-package} if defined $args->{-package};
die "Cannot have a default for a weakened field ($field)"
if defined $default && $args->{-weak};
return if defined &{"${package}::$field"};
require Scalar::Util if $args->{-weak};
my $default_string =
( ref($default) eq 'ARRAY' and not @$default )
inc/Spiffy.pm view on Meta::CPAN
}
$code .= sprintf $code{set_default}, $field, $default_string, $field
if defined $default;
$code .= sprintf $code{return_if_get}, $field;
$code .= sprintf $code{set}, $field;
$code .= sprintf $code{weaken}, $field, $field
if $args->{-weak};
$code .= sprintf $code{sub_end}, $field;
my $sub = eval $code;
die $@ if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/SQLite/Index.pm view on Meta::CPAN
use File::Spec::Functions qw(catfile);
use File::Basename;
use File::Path;
use HTTP::Tiny;
use Scalar::Util 'weaken';
unless ($ENV{CPAN_SQLITE_NO_LOG_FILES}) {
$ENV{CPAN_SQLITE_DEBUG} = 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/data/cpanriver.01.build.log view on Meta::CPAN
t/accessor-pred-clear.t ............ ok
t/accessor-reader-writer.t ......... ok
t/accessor-roles.t ................. ok
t/accessor-shortcuts.t ............. ok
t/accessor-trigger.t ............... ok
t/accessor-weaken-pre-5_8_3.t ...... ok
t/accessor-weaken.t ................ ok
t/buildall-subconstructor.t ........ ok
t/buildall.t ....................... ok
t/buildargs-error.t ................ ok
t/buildargs.t ...................... ok
t/coerce-1.t ....................... ok
view all matches for this distribution
view release on metacpan or search on metacpan
distroprefs/MLEHMANN.AnyEvent.yml view on Meta::CPAN
distribution: '^MLEHMANN/AnyEvent-7\.05'
goto: "MLEHMANN/AnyEvent-7.04.tar.gz"
---
comment: |
https://rt.perl.org/Ticket/Attachment/1508465/809040/0001-Re-weaken-timer-references-after-sorting.patch
https://www.nntp.perl.org/group/perl.perl5.porters/2017/11/msg247426.html
Patch is without a version change. I am not endorsing the patch, was
just trying to build AnyEvent with it to see what else happens to
AnyEvent::HTTP in the bleadperl v5.27 release cycle. Result was
https://rt.perl.org/Ticket/Display.html?id=132527 and so I commented
out following lines.
# match:
# distribution: '^MLEHMANN/AnyEvent-7\.14'
# patches:
# - "ANDK/patches/AnyEvent-7.14-weaken-timer-references-after-sorting.patch.gz"
# test:
# env:
# PERL_ANYEVENT_VERBOSE: 2
# depends:
# configure_requires:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPANPLUS/Dist/Debora/License.pm view on Meta::CPAN
our $VERSION = '0.018';
use parent qw(Software::License);
use File::Spec::Functions qw(catfile);
use Scalar::Util qw(weaken);
use Text::Wrap qw();
use CPANPLUS::Dist::Debora::Util qw(slurp_utf8);
# Common modules whose license might not be guessed.
lib/CPANPLUS/Dist/Debora/License.pm view on Meta::CPAN
delete $attrs->{package};
my $self = $class->SUPER::new($attrs);
$self->{package} = $package;
weaken $self->{package};
return $self;
}
sub name {
view all matches for this distribution
view release on metacpan or search on metacpan
* Added kpar()
* Only opportunisticly use Sub::Name, don't hard-depend on it in case
of pure-perl scenarios
0.07 CHANGES:
* Added note about perl before 5.8 not implementing weaken properly,
so possible memory leaks if gkwhile()'s continuations are lost
BUGFIXES:
* Second attempt at making gkwhile() work on perl 5.6
* Added dropk() analogous to liftk()
* Added 'use warnings'
* Various small updates to keep CPANTS happy
0.03 BUGFIXES:
* Declare dependency on at least perl 5.8 since weaken() fails tests on
earlier perls
0.02 CHANGES:
* Use Scalar::Util::weaken() in kwhile(), breaking cycle for $iter
and allowing body to care less about leaks. Also allows passthrough
of $k without intermediate sub{}
0.01 First version, released on an unsuspecting world.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPU/x86_64/InstructionWriter/RipRelative.pm view on Meta::CPAN
package CPU::x86_64::InstructionWriter::RipRelative;
our $VERSION = '0.005'; # VERSION
use strict;
use warnings;
use Carp;
use Scalar::Util 'weaken';
# ABSTRACT: Object representing an offset to a label
sub instruction { weaken($_[0]{instruction}= $_[1]) if @_ > 1; $_[0]{instruction} }
sub target { @_ > 1 && carp "Read-only"; $_[0]{target} }
sub name { 'rip-to-' . $_[0]{target}->name }
sub value {
my $self= shift;
if (($self->instruction->relative_to||0) == ($self->target->relative_to||0)) {
view all matches for this distribution
view release on metacpan or search on metacpan
sv_reftype|||
sv_release_COW|||
sv_replace|||
sv_report_used|||
sv_reset|||
sv_rvweaken||5.006000|
sv_setiv_mg|5.004050||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
sv_setpv_mg|5.004050||p
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CSS/DOM.pm view on Meta::CPAN
warnings;
use CSS::DOM::Exception
'SYNTAX_ERR' ,'HIERARCHY_REQUEST_ERR', 'INDEX_SIZE_ERR';
use CSS::DOM::Constants 'STYLE_RULE';
use Scalar::Util 'weaken';
require CSS::DOM::RuleList;
use constant 1.03 our $_constants = {
ruls => 0,
lib/CSS/DOM.pm view on Meta::CPAN
my $old = (my $self = shift) ->[dsbl];
@_ and $self->[dsbl] = shift;
$old
};
sub ownerNode { defined $_[0][node]?$_[0][node]:() }
sub set_ownerNode { weaken($_[0]->[node] = $_[1]) }
sub parentStyleSheet { shift->[prsh]||() }
sub _set_parentStyleSheet { weaken($_[0]->[prsh] = $_[1]) }
sub href { shift->[hrfe] }
sub set_href { $_[0]->[hrfe] = $_[1] }
sub title { no warnings 'uninitialized';
''.(shift->ownerNode || return)->attr('title') }
lib/CSS/DOM.pm view on Meta::CPAN
sub ownerRule {
shift->[ownr] || ()
}
sub _set_ownerRule {
weaken($_[0]->[ownr] = $_[1]);
}
# If you find a bug in the following three methods, Media.pmâs methods
# probably also need fixing.
sub cssRules {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CSS/ppport.h view on Meta::CPAN
sv_reftype|||
sv_release_COW|||
sv_replace|||
sv_report_used|||
sv_reset|||
sv_rvweaken||5.006000|
sv_setiv_mg|5.004050||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
sv_setpv_mg|5.004050||p
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
" return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
" unless \$#_ > 0 or defined \$_[0]->{%s};\n",
weak_init =>
" return do {\n" .
" \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
" \$_[0]->{%s};\n" .
" } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
return_if_get =>
" return \$_[0]->{%s} unless \$#_ > 0;\n",
set =>
" \$_[0]->{%s} = \$_[1];\n",
weaken =>
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
sub_end =>
" return \$_[0]->{%s};\n}\n",
);
sub field {
inc/Spiffy.pm view on Meta::CPAN
local *paired_arguments = sub { (qw(-package -init)) };
Spiffy->parse_arguments(@_);
};
my ($field, $default) = @values;
$package = $args->{-package} if defined $args->{-package};
die "Cannot have a default for a weakened field ($field)"
if defined $default && $args->{-weak};
return if defined &{"${package}::$field"};
require Scalar::Util if $args->{-weak};
my $default_string =
( ref($default) eq 'ARRAY' and not @$default )
inc/Spiffy.pm view on Meta::CPAN
}
$code .= sprintf $code{set_default}, $field, $default_string, $field
if defined $default;
$code .= sprintf $code{return_if_get}, $field;
$code .= sprintf $code{set}, $field;
$code .= sprintf $code{weaken}, $field, $field
if $args->{-weak};
$code .= sprintf $code{sub_end}, $field;
my $sub = eval $code;
die $@ if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
" return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
" unless \$#_ > 0 or defined \$_[0]->{%s};\n",
weak_init =>
" return do {\n" .
" \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
" \$_[0]->{%s};\n" .
" } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
return_if_get =>
" return \$_[0]->{%s} unless \$#_ > 0;\n",
set =>
" \$_[0]->{%s} = \$_[1];\n",
weaken =>
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
sub_end =>
" return \$_[0]->{%s};\n}\n",
);
sub field {
inc/Spiffy.pm view on Meta::CPAN
local *paired_arguments = sub { (qw(-package -init)) };
Spiffy->parse_arguments(@_);
};
my ($field, $default) = @values;
$package = $args->{-package} if defined $args->{-package};
die "Cannot have a default for a weakened field ($field)"
if defined $default && $args->{-weak};
return if defined &{"${package}::$field"};
require Scalar::Util if $args->{-weak};
my $default_string =
( ref($default) eq 'ARRAY' and not @$default )
inc/Spiffy.pm view on Meta::CPAN
}
$code .= sprintf $code{set_default}, $field, $default_string, $field
if defined $default;
$code .= sprintf $code{return_if_get}, $field;
$code .= sprintf $code{set}, $field;
$code .= sprintf $code{weaken}, $field, $field
if $args->{-weak};
$code .= sprintf $code{sub_end}, $field;
my $sub = eval $code;
die $@ if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/CacheFactory/Object.pm view on Meta::CPAN
$data = Storable::dclone( $data )
if ref( $data ) and not $param->{ no_deep_clone };
# Set the data.
$self->set_data( $data );
# TODO: weaken ref param handling here?
# Overrule default properties if they've been supplied.
foreach my $property ( qw/created_at accessed_at expires_at/ )
{
if( exists( $param->{ $property } ) )
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
" return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
" unless \$#_ > 0 or defined \$_[0]->{%s};\n",
weak_init =>
" return do {\n" .
" \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
" \$_[0]->{%s};\n" .
" } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
return_if_get =>
" return \$_[0]->{%s} unless \$#_ > 0;\n",
set =>
" \$_[0]->{%s} = \$_[1];\n",
weaken =>
" Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
sub_end =>
" return \$_[0]->{%s};\n}\n",
);
sub field {
inc/Spiffy.pm view on Meta::CPAN
local *paired_arguments = sub { (qw(-package -init)) };
Spiffy->parse_arguments(@_);
};
my ($field, $default) = @values;
$package = $args->{-package} if defined $args->{-package};
die "Cannot have a default for a weakened field ($field)"
if defined $default && $args->{-weak};
return if defined &{"${package}::$field"};
require Scalar::Util if $args->{-weak};
my $default_string =
( ref($default) eq 'ARRAY' and not @$default )
inc/Spiffy.pm view on Meta::CPAN
}
$code .= sprintf $code{set_default}, $field, $default_string, $field
if defined $default;
$code .= sprintf $code{return_if_get}, $field;
$code .= sprintf $code{set}, $field;
$code .= sprintf $code{weaken}, $field, $field
if $args->{-weak};
$code .= sprintf $code{sub_end}, $field;
my $sub = eval $code;
die $@ if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/FastMmap.pm view on Meta::CPAN
}
# If using empty_on_exit, need to track used caches
my $empty_on_exit = $Self->{empty_on_exit} = int($Args{empty_on_exit} || 0);
# Need Scalar::Util::weaken to track open caches
if ($empty_on_exit) {
eval "use Scalar::Util qw(weaken); 1;"
|| die "Could not load Scalar::Util module: $@";
}
# Work out expiry time in seconds
my $expire_time = $Self->{expire_time} = parse_expire_time($Args{expire_time});
lib/Cache/FastMmap.pm view on Meta::CPAN
# And initialise it
fc_init($Cache);
# Track cache if need to empty on exit
weaken($LiveCaches{ref($Self)} = $Self)
if $empty_on_exit;
# All done, return PERL hash ref as class
return $Self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/LRU.pm view on Meta::CPAN
$$old_value_ref = undef;
}
# register
my $value_ref = \$value;
Scalar::Util::weaken($entries->{$key} = $value_ref);
$self->_update_fifo($key, $value_ref);
# expire the oldest entry if full
while (scalar(keys %$entries) > $self->{size}) {
my $exp_key = shift(@{$self->{_fifo}})->[0];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/AnyEvent.pm view on Meta::CPAN
};
foreach my $method ( qw( get get_multi ) ) {
$installer->( $method, sub {
my ($self, $keys, $cb) = @_;
Scalar::Util::weaken($self);
$self->_push_queue( $self->protocol->$method($self, $keys, $cb) );
} );
}
foreach my $method ( qw( decr incr ) ) {
$installer->($method, sub {
my ($self, @args) = @_;
my $cb = pop @args if (ref $args[-1] eq 'CODE' or ref $args[-1] eq 'AnyEvent::CondVar');
my ($key, $value, $initial) = @args;
Scalar::Util::weaken($self);
$self->_push_queue( $self->protocol->$method( $self, $key, $value, $initial, $cb ) );
});
}
foreach my $method ( qw(add append prepend replace set) ) {
$installer->($method, sub {
my ($self, @args) = @_;
my $cb = pop @args if (ref $args[-1] eq 'CODE' or ref $args[-1] eq 'AnyEvent::CondVar');
my ($key, $value, $exptime, $noreply) = @args;
Scalar::Util::weaken($self);
$self->_push_queue( $self->protocol->$method( $self, $key, $value, $exptime, $noreply, $cb ) );
});
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/Fast/Safe.pm view on Meta::CPAN
use warnings;
use Cache::Memcached::Fast 0.19;
use Digest::SHA qw/sha1_hex/;
use parent qw/Cache::Memcached::Fast/;
use POSIX::AtFork;
use Scalar::Util qw/weaken/;
our $VERSION = '0.06';
our $SANITIZE_METHOD = \&_sanitize_method;
{
lib/Cache/Memcached/Fast/Safe.pm view on Meta::CPAN
sub new {
my $class = shift;
my %args = ref $_[0] ? %{$_[0]} : @_;
my $mem = $class->SUPER::new(\%args);
# fork safe
weaken(my $mem_weaken = $mem);
POSIX::AtFork->add_to_child(sub {
eval { $mem_weaken->disconnect_all };
});
$mem;
}
for my $method ( qw/set cas add replace append prepend incr decr delete touch/ ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/Fast.pm view on Meta::CPAN
$conf->{serialize_methods} //= [ \&Storable::nfreeze, \&Storable::thaw ];
my $memd = $class->_new($conf);
my $context = [ $memd, $conf ];
_weaken( $context->[0] );
$instance{$$memd} = $context;
return $memd;
}
view all matches for this distribution
view release on metacpan or search on metacpan
sv_release_COW|||
sv_release_IVX|||
sv_replace|||
sv_report_used|||
sv_reset|||
sv_rvweaken||5.006000|
sv_setiv_mg|5.006000||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
sv_setpv_mg|5.006000||p
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/libmemcached.pm view on Meta::CPAN
MEMCACHED_PREFIX_KEY_MAX_SIZE
);
use base qw(Memcached::libmemcached);
use Carp qw(croak carp);
use Scalar::Util qw(weaken);
use Storable ();
our $VERSION = '0.04001';
use constant HAVE_ZLIB => eval { require Compress::Zlib } && !$@;
lib/Cache/Memcached/libmemcached.pm view on Meta::CPAN
sub _mk_callbacks
{
my $self = shift;
weaken($self);
my $inflate = sub {
my ($key, $flags) = @_;
if ($flags & F_COMPRESS) {
if (! HAVE_ZLIB) {
croak("Data for $key is compressed, but we have no Compress::Zlib");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Sliding.pm view on Meta::CPAN
use utf8;
use Carp;
our $VERSION = 'v2.0.1';
use Scalar::Util qw( weaken );
use EV;
sub new {
my ($class, $expire_after) = @_;
my $self = {
L1 => {},
L2 => {},
t => undef,
};
weaken(my $this = $self);
$self->{t} = EV::timer $expire_after, $expire_after, sub { if ($this) {
$this->{L2} = $this->{L1};
$this->{L1} = {};
} };
return bless $self, $class;
view all matches for this distribution
view release on metacpan or search on metacpan
sv_release_COW|||
sv_release_IVX|||
sv_replace|||
sv_report_used|||
sv_reset|||
sv_rvweaken||5.006000|
sv_setiv_mg|5.006000||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
sv_setpv_mg|5.006000||p
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Weak.pm view on Meta::CPAN
use warnings;
use version; our $VERSION = qv('1.0.3');
use Carp qw/carp croak/;
use Scalar::Util qw/weaken/;
use constant {
DEFAULT_NAMESPACE => '_',
DEFAULT_AUTO_PURGE_INTERVAL => 1000,
DEFAULT_AUTO_PURGE => 1,
lib/Cache/Weak.pm view on Meta::CPAN
# is it time to purge cache from dead objects?
if ( $self->auto_purge ) {
$self->purge unless ( $self->_inc_count % $self->auto_purge_interval );
}
weaken ( $cache_data{ $self->namespace }{$key} = $object );
return 1;
}
sub remove {
my ( $self, $key ) = @_;
lib/Cache/Weak.pm view on Meta::CPAN
=head1 DEPENDENCIES
This module requires weak references support in your system.
To find out if your system supports weak references, you can run this on the command line:
perl -e 'use Scalar::Util qw(weaken)'
If you get an error message about weak references not being implemented, this module would
not work.
=head1 SEE ALSO
view all matches for this distribution