view release on metacpan or search on metacpan
lib/BusyBird/Flow.pm view on Meta::CPAN
use warnings;
use Async::Queue;
use BusyBird::Log qw(bblog);
use CPS qw(kforeach);
use Carp;
use Scalar::Util qw(weaken);
use Try::Tiny;
sub new {
my ($class) = @_;
my $self = bless {
lib/BusyBird/Flow.pm view on Meta::CPAN
return $self;
}
sub _create_queue {
my ($self) = @_;
weaken $self;
return Async::Queue->new(concurrency => 1, worker => sub {
my ($data, $done) = @_;
kforeach $self->{filters}, sub {
my ($filter, $knext) = @_;
try {
view all matches for this distribution
view release on metacpan or search on metacpan
sv_release_COW|||
sv_replace|||
sv_report_used|||
sv_resetpvn|||
sv_reset|||
sv_rvweaken||5.006000|
sv_sethek|||
sv_setiv_mg|5.004050||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
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
sv_release_COW|||
sv_replace|||
sv_report_used|||
sv_resetpvn|||
sv_reset|||
sv_rvweaken||5.006000|
sv_sethek|||
sv_setiv_mg|5.004050||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
view all matches for this distribution
view release on metacpan or search on metacpan
easyxs/ppport.h view on Meta::CPAN
sv_ref||5.015004|
sv_replace|||
sv_report_used|||
sv_resetpvn|||
sv_reset|||
sv_rvweaken||5.006000|
sv_sethek|||
sv_setiv_mg|5.004050||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
view all matches for this distribution
view release on metacpan or search on metacpan
structures to contain cycles, but unlike C<allow_cycles>, those cyclic
rreferences will be weak. That means that code that recurrsively walks
the data structure must be prepared with cycles, but at least not special
precautions must be implemented to free these data structures.
Only those references leading to actual cycles will be weakened - other
references, e.g. when the same hash or arrray is referenced multiple times
in an arrray, will be normal references.
This option does not affect C<encode> in any way - shared values and
references will always be encoded properly if present.
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
SvROK_off|5.003007|5.003007|
SvROK_on|5.003007|5.003007|
SvRV|5.003007|5.003007|
SvRV_const|5.010001||Viu
SvRV_set|5.009003|5.003007|p
sv_rvunweaken|5.027004|5.027004|
sv_rvweaken|5.006000|5.006000|
SvRVx|5.003007||Viu
SvRX|5.009005|5.003007|p
SvRXOK|5.009005|5.003007|p
SV_SAVED_COPY|5.009005||Viu
SvSCREAM|5.003007||Viu
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/CGI/Application/Plugin/AnyTemplate.pm view on Meta::CPAN
=cut
use strict;
use CGI::Application;
use Carp;
use Scalar::Util qw(weaken);
if ( ! eval { require Clone } ) {
if ( eval { require Clone::PP } ) {
no strict 'refs';
*Clone::clone = *Clone::PP::clone;
lib/CGI/Application/Plugin/AnyTemplate.pm view on Meta::CPAN
'webapp' => $webapp,
};
bless $self, $class;
weaken $self->{'webapp'};
return $self;
}
sub _default_type { 'HTMLTemplate' }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Plugin/Authentication.pm view on Meta::CPAN
my $cgiapp = shift;
my $self = {};
bless $self, $class;
$self->{cgiapp} = $cgiapp;
Scalar::Util::weaken($self->{cgiapp}); # weaken circular reference
return $self;
}
=head2 instance
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Plugin/Authorization.pm view on Meta::CPAN
my $self = {};
bless $self, $class;
$self->{name} = $name;
$self->{cgiapp} = $cgiapp;
Scalar::Util::weaken( $self->{cgiapp} )
if ref $self->{cgiapp}; # weaken circular reference
return $self;
}
=head2 instance
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/CGI/Application/Plugin/Config/Context.pm view on Meta::CPAN
use CGI::Application;
use Config::Context;
use Carp;
use File::Spec;
use Scalar::Util qw(weaken isweak);
use Cwd;
use vars '@EXPORT';
@EXPORT = qw(conf);
lib/CGI/Application/Plugin/Config/Context.pm view on Meta::CPAN
'__CONFIG_OBJ' => undef,
};
# Force reference to CGI::Application object to be weak to avoid
# circular references
weaken($self->{'__CGIAPP_OBJ'});
return bless $self, $class;
}
=head2 init
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Plugin/Config/General.pm view on Meta::CPAN
use CGI::Application;
use Config::General::Match;
use Carp;
use File::Spec;
use Scalar::Util qw(weaken isweak);
use Cwd;
use vars '@EXPORT';
@EXPORT = qw(conf);
lib/CGI/Application/Plugin/Config/General.pm view on Meta::CPAN
'__CONFIG' => undef,
};
# Force reference to CGI::Applcation object to be weak to avoid
# circular references
weaken($self->{'__CGIAPP_OBJ'});
return bless $self, $class;
}
=head2 init
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Plugin/FormState.pm view on Meta::CPAN
use CGI::Application::Plugin::Session;
use vars qw(@ISA @EXPORT);
use Carp;
use Scalar::Util qw(weaken isweak);
use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(form_state);
lib/CGI/Application/Plugin/FormState.pm view on Meta::CPAN
'__CONFIGURED' => undef,
};
# Force reference to CGI::Application object to be weak to avoid
# circular references
weaken($self->{'__CGIAPP_OBJ'});
return bless $self, $class;
}
sub form_state {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Builder/Auth/Group.pm view on Meta::CPAN
}
; sub DESTROY
{ ref($_group_admin)
and !Scalar::Util::isweak($_group_admin)
and Scalar::Util::weaken($_group_admin)
}
=head1 NAME
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Builder/TT2.pm view on Meta::CPAN
sub CGI::Builder::TT2::_::tt_print
{
my $s = shift;
Scalar::Util::weaken( $s );
$s->tt_vars( CBF => sub { return $s } );
{
# Inspect the symbol table of the Lookups package, store refs
# in tt_vars for TT to use.
lib/CGI/Builder/TT2.pm view on Meta::CPAN
sub CGI::Builder::TT2::_::make_wrapper
{
my $code = shift;
my $app_object = shift;
# Stop memory leak by weakening enclosed references
Scalar::Util::weaken($app_object);
return sub {
unshift @_, $app_object;
goto &{ $code };
}
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
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
erecipes/perl/lib/CGI/Ex/Recipes.pm view on Meta::CPAN
sub hash_base {
my $self = shift;
my $hash = $self->SUPER::hash_base(@_);
$hash->{'app'} = $self;
#require Scalar::Util;
Scalar::Util::weaken($hash->{'app'});
return $hash;
}
sub post_navigate {
erecipes/perl/lib/CGI/Ex/Recipes.pm view on Meta::CPAN
Get authentication arguments from configuration if there is such
and returns a hashref. The template_args are merged in also.
=head2 hash_base
The extra work done here is that we use L<Scalar::Util|Scalar::Util> to C<weaken>
the reference to the main application which we pass for use from within the templates and
template plugins. Without doing this we may have problems under persistent environments, such as
mod_perl. This is very handy when you need to dynamically generate HTML or
use the attached DBI object.
See L<CGI::Ex::Recipes::Template::Menu|CGI::Ex::Recipes::Template::Menu>, L<CGI::Ex::App|CGI::Ex::App>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Ex/App.pm view on Meta::CPAN
my $hash = $self->{'hash_base'} ||= {
script_name => $self->script_name,
path_info => $self->path_info,
};
my $copy = $self; eval { require Scalar::Util; Scalar::Util::weaken($copy) };
$hash->{'js_validation'} = sub { $copy->run_hook('js_validation', $step, shift) };
$hash->{'generate_form'} = sub { $copy->run_hook('generate_form', $step, (ref($_[0]) ? (undef, shift) : shift)) };
$hash->{'form_name'} = $self->run_hook('form_name', $step);
$hash->{$self->step_key} = $step;
return $hash;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/FormBuilder.pm view on Meta::CPAN
use Carp;
use strict;
use warnings;
no warnings 'uninitialized';
use Scalar::Util qw(weaken);
use CGI::FormBuilder::Util;
use CGI::FormBuilder::Field;
use CGI::FormBuilder::Messages;
lib/CGI/FormBuilder.pm view on Meta::CPAN
$_->field(%fprop);
} else {
# init a new one
$fprop{name} = "$_";
$_ = $self->new_field(%fprop);
weaken($_->{_form});
}
debug 2, "push \@(@ftmp), $_";
weaken($self->{fieldrefs}{"$_"} = $_);
push @ftmp, $_;
}
# stringifiable objects (overwrite previous container)
$self->{fields} = \@ftmp;
lib/CGI/FormBuilder.pm view on Meta::CPAN
return unless keys %$args > 1;
# if we're still in here, we need to init a new field
# push it onto our mail fields array, just like initfields()
my $f = $self->new_field(%$args);
weaken($self->{fieldrefs}{"$f"} = $f);
weaken($f->{_form});
weaken($f->{fieldrefs}{"$f"});
push @{$self->{fields}}, $f;
return $f->value;
}
lib/CGI/FormBuilder.pm view on Meta::CPAN
$ref = 'HASH'; # tricky
debug 2, "rewrote 'template' option since found filename";
}
# Get ourselves ready
$self->{prepare} = $self->prepare;
# weaken($self->{prepare});
my $opt;
if ($ref eq 'HASH') {
# must copy to avoid destroying
$opt = { %{ $self->{template} } };
lib/CGI/FormBuilder.pm view on Meta::CPAN
debug 1, "returning $tmpl->render($self->{prepare})";
my $ret = $self->header . $tmpl->render($self->{prepare});
#we have a circular reference but we need to kill it after setting up return
weaken($self->{prepare});
return $ret;
}
# These routines should be moved to ::Mail or something since they're rarely used
sub mail () {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CHI/Cascade/Rule.pm view on Meta::CPAN
use strict;
use warnings;
use v5.10;
use Scalar::Util 'weaken';
sub new {
my ($class, %opts) = @_;
my $from = ref($class) ? $class : \%opts;
lib/CHI/Cascade/Rule.pm view on Meta::CPAN
matched_target => undef
}, ref($class) || $class;
if ( $opts{run_instance} ) {
$self->{run_instance} = $opts{run_instance};
weaken $self->{run_instance}; # It is against memory leaks
}
weaken $self->{cascade}; # It is against memory leaks
$self->{resolved_depends} = undef;
$self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CHI/Driver/LMDB.pm view on Meta::CPAN
=head2 C<NOSYNC> Mode.
You can also tell LMDB B<NOT> to call C<sync> at the end of every transaction,
and this will greatly improve write performance due to IO being greatly delayed.
This greatly weakens the databases consistency, but that seems like a respectable
compromise for a mere cache backend, where a missing record is a performance hit, not a loss of data.
use LMDB_File qw( MDB_NOSYNC MDB_NOMETASYNC );
...
my $cache = CHI->new(
view all matches for this distribution
view release on metacpan or search on metacpan
Returns the type of subcache as a string, e.g. 'l1_cache' or 'mirror_cache'.
Can only be called if I<is_subcache> is true.
=item parent_cache( )
Returns the parent cache (weakened to prevent circular reference). Can only be
called if I<is_subcache> is true.
=back
=head2 Developing new kinds of subcaches
view all matches for this distribution
view release on metacpan or search on metacpan
SvROK|5.003007|5.003007|
SvROK_off|5.003007|5.003007|
SvROK_on|5.003007|5.003007|
SvRV|5.003007|5.003007|
SvRV_set|5.009003|5.003007|p
sv_rvunweaken|5.027004|5.027004|
sv_rvweaken|5.006000|5.006000|
SvRX|5.009005|5.003007|p
SvRXOK|5.009005|5.003007|p
sv_sethek|5.015004||cViu
sv_setiv|5.003007|5.003007|
sv_setiv_mg|5.004005|5.003007|p
view all matches for this distribution
view release on metacpan or search on metacpan
easyxs/ppport.h view on Meta::CPAN
SvROK_off|5.003007|5.003007|
SvROK_on|5.003007|5.003007|
SvRV|5.003007|5.003007|
SvRV_const|5.010001||Viu
SvRV_set|5.009003|5.003007|p
sv_rvunweaken|5.027004|5.027004|
sv_rvweaken|5.006000|5.006000|
SvRVx|5.003007||Viu
SvRX|5.009005|5.003007|p
SvRXOK|5.009005|5.003007|p
SV_SAVED_COPY|5.009005||Viu
SvSCREAM|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
Debian_CPANTS.txt view on Meta::CPAN
"libtest-unit-perl", "Test-Unit", "0.25", "0", "1"
"libtest-use-ok-perl", "Test-use-ok", "0.02", "0", "0"
"libtest-useallmodules-perl", "Test-UseAllModules", "0.12", "0", "0"
"libtest-valgrind-perl", "Test-Valgrind", "1.12", "0", "0"
"libtest-warn-perl", "Test-Warn", "0.22", "0", "1"
"libtest-weaken-perl", "Test-Weaken", "3.004000", "0", "0"
"libtest-without-module-perl", "Test-Without-Module", "0.17", "0", "0"
"libtest-www-declare-perl", "Test-WWW-Declare", "0.02", "0", "0"
"libtest-www-mechanize-catalyst-perl", "Test-WWW-Mechanize-Catalyst", "0.53", "0", "0"
"libtest-www-mechanize-cgiapp-perl", "Test-WWW-Mechanize-CGIApp", "0.05", "0", "0"
"libtest-www-mechanize-mojo-perl", "Test-WWW-Mechanize-Mojo", "0.0.8", "0", "0"
view all matches for this distribution