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
inc/Pegex/Parser.pm view on Meta::CPAN
receiver => $self->{receiver},
);
$optimizer->optimize_grammar($start_rule_ref);
# Add circular ref and weaken it.
$self->{receiver}{parser} = $self;
Scalar::Util::weaken($self->{receiver}{parser});
if ($self->{receiver}->can("initial")) {
$self->{rule} = $start_rule_ref;
$self->{parent} = {};
$self->{receiver}->initial();
view all matches for this distribution
view release on metacpan or search on metacpan
dev/xml-test.pl view on Meta::CPAN
use strict;
use warnings;
use XML::SAX;
use XML::SAX::ParserFactory;
use Scalar::Util qw(weaken);
use Test::More tests => 11;
use Data::Dumper;
my $mode = shift;
dev/xml-test.pl view on Meta::CPAN
} else {
ok(1);
}
$p->parse_string($fulldoc);
$weakcheck = \$p;
weaken($weakcheck);
$weakcheck_h = \$handler;
weaken($weakcheck_h);
like($full_events, qr/\{aa\}name/, "parser supports namespaces properly");
like($full_events, qr/\{bb\}name/, "parser supports namespaces properly");
like($full_events, qr/\{\}global/, "parser supports namespaces properly");
}
dev/xml-test.pl view on Meta::CPAN
my $handler = EventRecorder->new(\$streamed_events);
my $p = $factory->parser(Handler => $handler);
$p->$iter_method($first_chunk);
$p->$iter_method($second_chunk);
$weakcheck = \$p;
weaken($weakcheck);
}
is($weakcheck, undef, "parser was destroyed");
use Text::Diff;
dev/xml-test.pl view on Meta::CPAN
use XML::LibXML;
use XML::SAX::Base;
use base qw(XML::SAX::Base);
use Carp;
use Data::Dumper;
use Scalar::Util qw(weaken);
sub new {
my ($class, @params) = @_;
my $inst = $class->SUPER::new(@params);
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
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
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
test_data/big.log view on Meta::CPAN
2010-07-13 12:18:58 status half-installed libwww-perl 5.813-1
2010-07-13 12:18:58 status half-installed libwww-perl 5.813-1
2010-07-13 12:18:59 status half-installed libwww-perl 5.813-1
2010-07-13 12:18:59 status unpacked libwww-perl 5.836-1
2010-07-13 12:18:59 status unpacked libwww-perl 5.836-1
2010-07-13 12:18:59 install libtask-weaken-perl <keine> 1.03-1
2010-07-13 12:18:59 status half-installed libtask-weaken-perl 1.03-1
2010-07-13 12:18:59 status half-installed libtask-weaken-perl 1.03-1
2010-07-13 12:18:59 status unpacked libtask-weaken-perl 1.03-1
2010-07-13 12:18:59 status unpacked libtask-weaken-perl 1.03-1
2010-07-13 12:18:59 upgrade libsoap-lite-perl 0.710.08-1 0.712-1
2010-07-13 12:18:59 status half-configured libsoap-lite-perl 0.710.08-1
2010-07-13 12:18:59 status unpacked libsoap-lite-perl 0.710.08-1
2010-07-13 12:18:59 status half-installed libsoap-lite-perl 0.710.08-1
2010-07-13 12:19:00 status half-installed libsoap-lite-perl 0.710.08-1
test_data/big.log view on Meta::CPAN
2010-07-13 12:23:50 status installed libslv2-9 0.6.6-4
2010-07-13 12:23:50 configure libwww-perl 5.836-1 5.836-1
2010-07-13 12:23:50 status unpacked libwww-perl 5.836-1
2010-07-13 12:23:50 status half-configured libwww-perl 5.836-1
2010-07-13 12:23:50 status installed libwww-perl 5.836-1
2010-07-13 12:23:50 configure libtask-weaken-perl 1.03-1 1.03-1
2010-07-13 12:23:50 status unpacked libtask-weaken-perl 1.03-1
2010-07-13 12:23:50 status half-configured libtask-weaken-perl 1.03-1
2010-07-13 12:23:50 status installed libtask-weaken-perl 1.03-1
2010-07-13 12:23:50 configure libsoap-lite-perl 0.712-1 0.712-1
2010-07-13 12:23:50 status unpacked libsoap-lite-perl 0.712-1
2010-07-13 12:23:50 status half-configured libsoap-lite-perl 0.712-1
2010-07-13 12:23:50 status installed libsoap-lite-perl 0.712-1
2010-07-13 12:23:50 configure libsoup-gnome2.4-1 2.30.2-1 2.30.2-1
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DR/Tarantool/AEConnection.pm view on Meta::CPAN
$self->_check_reconnect;
}
sub _check_reconnect {
Scalar::Util::weaken(my $self = shift);
return if $self->state eq 'connected';
return if $self->state eq 'connecting';
return if $self->{guard}{rc};
return unless $self->reconnect_period;
lib/DR/Tarantool/AEConnection.pm view on Meta::CPAN
$self->connect;
};
}
sub connect {
Scalar::Util::weaken(my $self = shift);
return if $self->state eq 'connected' or $self->state eq 'connecting';
$self->{state} = 'connecting';
$self->{error} = undef;
lib/DR/Tarantool/AEConnection.pm view on Meta::CPAN
$self;
}
sub disconnect {
Scalar::Util::weaken(my $self = shift);
return if $self->state eq 'disconnect' or $self->state eq 'init';
$self->{guard} = {};
$self->{error} = 'Disconnected';
$self->{errno} = 'SUCCESS';
lib/DR/Tarantool/AEConnection.pm view on Meta::CPAN
$self->{on}{disconnect}($self);
}
sub push_write {
Scalar::Util::weaken(my $self = shift);
my ($str) = @_;
$self->{wbuf} .= $str;
return unless $self->state eq 'connected';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DSP/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
CAB/Analyzer.pm view on Meta::CPAN
use DTA::CAB::Persistent;
use DTA::CAB::Logger;
use DTA::CAB::Datum ':all';
use DTA::CAB::Utils ':minmax', ':files', ':time';
use File::Basename qw(basename dirname);
use Scalar::Util qw(weaken);
use Exporter;
use Carp;
use strict;
##==============================================================================
CAB/Analyzer.pm view on Meta::CPAN
## + default implementation calls $anl->getAnalyze"${which}"Closure() if
## available, otherwise croak()s
sub getAnalyzeClosure {
my ($anl,$which) = @_;
my $getsub = $anl->can("getAnalyze${which}Closure");
weaken($anl);
return $getsub->($anl) if ($getsub);
$anl->logconfess("getAnalyzeClosure('$which'): no getAnalyze${which}Closure() method defined!");
}
##------------------------------------------------------------------------
CAB/Analyzer.pm view on Meta::CPAN
my $do_cache = !exists($opts{cache}) || $opts{cache};
my $sub = ($do_cache ? $CLOSURE_CACHE{$anl}{$code} : undef);
my $cached = $sub ? 1 : 0;
weaken($anl);
$sub ||= eval $code;
$anl->logcluck("accessClosure(): could not compile closure {$code}: $@") if (!$sub);
$CLOSURE_CACHE{$anl}{$code} = $sub if ($do_cache && !$cached);
return $sub;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DTL/Fast/Entity.pm view on Meta::CPAN
use strict;
use utf8;
use warnings FATAL => 'all';
# prototype for template entity. Handling current line and current template references
use Scalar::Util qw(weaken);
use Carp qw(confess);
sub new
{
my ( $proto, %kwargs ) = @_;
lib/DTL/Fast/Entity.pm view on Meta::CPAN
{
my ($self) = @_;
$self->{_template} = $DTL::Fast::Template::CURRENT_TEMPLATE;
$self->{_template_line} = $DTL::Fast::Template::CURRENT_TEMPLATE_LINE;
weaken $self->{_template};
return $self;
}
sub get_parse_error
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/DWH_File/Cache.pm view on Meta::CPAN
bless $self, $class;
return $self;
}
sub encache {
# weaken if available
$_[ 0 ]->{ $_[ 1 ]->cache_key } = $_[ 1 ];
$_[ 1 ]->cache_up;
}
sub decache {
view all matches for this distribution
view release on metacpan or search on metacpan
_Deparsed_XSubs.pm view on Meta::CPAN
package Class::MOP {
sub blessed($) ;
sub check_package_cache_flag($) ;
sub get_code_info($) ;
sub isweak($) ;
sub weaken($) ;
}
package Class::MOP::Attribute {
sub associated_class;
sub associated_methods;
sub blessed($) ;
sub weaken($) ;
}
package Class::MOP::Class {
sub all(&@) ;
sub blessed($) ;
sub constructor_class;
_Deparsed_XSubs.pm view on Meta::CPAN
sub associated_metaclass;
sub blessed($) ;
sub isweak($) ;
sub slot_hash;
sub slots;
sub weaken($) ;
}
package Class::MOP::Method {
sub blessed($) ;
sub body;
sub is_stub;
sub name;
sub package_name;
sub reftype($) ;
sub weaken($) ;
}
package Class::MOP::Method::Accessor {
sub blessed($) ;
sub weaken($) ;
}
package Class::MOP::Method::Constructor {
sub blessed($) ;
sub weaken($) ;
}
package Class::MOP::Method::Generated {
sub definition_context;
sub is_inline;
}
_Deparsed_XSubs.pm view on Meta::CPAN
sub _expected_method_class;
sub refaddr($) ;
}
package Class::MOP::Method::Meta {
sub blessed($) ;
sub weaken($) ;
}
package Class::MOP::Method::Wrapped {
sub blessed($) ;
sub set_subname;
}
_Deparsed_XSubs.pm view on Meta::CPAN
package Class::MOP::Object {
sub blessed($) ;
}
package Class::MOP::Overload {
sub blessed($) ;
sub weaken($) ;
}
package Class::MOP::Package {
sub blessed($) ;
sub name;
sub weaken($) ;
}
package Class::XSAccessor {
sub __entersub_optimized__() ;
sub _newxs_compat_accessor;
sub _newxs_compat_setter;
_Deparsed_XSubs.pm view on Meta::CPAN
package Devel::MAT::Cmd::_base {
sub max(@) ;
sub perlstring;
}
package Devel::MAT::Context {
sub weaken($) ;
}
package Devel::MAT::Dumper {
sub ARG_MAX() ;
sub CHILD_MAX() ;
sub CLK_TCK() ;
_Deparsed_XSubs.pm view on Meta::CPAN
sub df;
sub first(&@) ;
sub glob_at;
sub refcnt;
sub size;
sub weaken($) ;
}
package Devel::MAT::SV::ARRAY {
sub DESTROY;
sub _clear_elem;
sub _set_array_fields;
_Deparsed_XSubs.pm view on Meta::CPAN
}
package Future::PP {
sub blessed($) ;
sub gettimeofday() ;
sub reftype($) ;
sub weaken($) ;
}
package Future::_base {
sub blessed($) ;
sub svref_2object;
}
_Deparsed_XSubs.pm view on Meta::CPAN
}
package Moose::Meta::Class::Immutable::Trait {
sub blessed($) ;
}
package Moose::Meta::Method::Constructor {
sub weaken($) ;
}
package Moose::Meta::Method::Delegation {
sub blessed($) ;
sub weaken($) ;
}
package Moose::Meta::Method::Destructor {
sub blessed($) ;
sub weaken($) ;
}
package Moose::Meta::Object::Trait {
sub blessed($) ;
}
package Moose::Meta::Role {
_Deparsed_XSubs.pm view on Meta::CPAN
sub all(&@) ;
sub blessed($) ;
}
package Moose::Meta::Role::Application::ToClass {
sub first(&@) ;
sub weaken($) ;
}
package Moose::Meta::Role::Application::ToInstance {
sub _reset_amagic;
sub all(&@) ;
sub blessed($) ;
}
package Moose::Meta::Role::Attribute {
sub all(&@) ;
sub blessed($) ;
sub weaken($) ;
}
package Moose::Meta::Role::Composite {
sub blessed($) ;
}
package Moose::Meta::TypeCoercion::Union {
_Deparsed_XSubs.pm view on Meta::CPAN
sub openhandle($) ;
sub readonly($) ;
sub refaddr($) ;
sub reftype($) ;
sub tainted($) ;
sub unweaken($) ;
sub weaken($) ;
}
package Scalar::Util::LooksLikeNumber {
sub looks_like_number($) ;
}
package Scalar::Util::Numeric {
_Deparsed_XSubs.pm view on Meta::CPAN
}
package Specio::OO {
sub all(&@) ;
sub dclone($) ;
sub perlstring;
sub weaken($) ;
}
package Specio::PartialDump {
sub blessed($) ;
sub looks_like_number($) ;
sub reftype($) ;
_Deparsed_XSubs.pm view on Meta::CPAN
sub pixels;
}
package Test2::API {
sub blessed($) ;
sub time() ;
sub weaken($) ;
}
package Test2::API::Context {
sub blessed($) ;
sub weaken($) ;
}
package Test2::API::Instance {
sub reftype($) ;
}
package Test2::Event {
_Deparsed_XSubs.pm view on Meta::CPAN
package Test2::EventFacet::Trace {
sub time() ;
}
package Test2::Hub {
sub first(&@) ;
sub weaken($) ;
}
package Test2::Util::Facets2Legacy {
sub blessed($) ;
}
package Test2::Util::HashBase {
sub _isa($;$) ;
}
package Test::Builder {
sub blessed($) ;
sub reftype($) ;
sub weaken($) ;
}
package Test::LeakTrace {
sub CLONE;
sub _finish;
sub _runops_installed;
_Deparsed_XSubs.pm view on Meta::CPAN
sub refaddr($) ;
sub reftype($) ;
sub stringify($) ;
sub trim($) ;
sub true() ;
sub unweaken($) ;
sub weaken($) ;
}
package constant {
sub _make_const(\[$@]) ;
}
package indirect {
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
lib/Dancer/Logger/File/PerRequest.pm view on Meta::CPAN
return $file . '-' . $$ . '-' . $request_id . '.log';
};
$self->{logfile_callback} = $logfile_callback;
# per request
Scalar::Util::weaken $self;
my $on_end = sub {
return unless $self->{fh};
Dancer::Factory::Hook->execute_hooks('before_file_per_request_close', $self->{fh}, $self->{logfile});
close($self->{fh}); # close
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mail/Email/IMAP.pm view on Meta::CPAN
package Mail::Email::IMAP;
use strict;
use MIME::WordDecoder;
use MIME::Base64;
use MIME::QuotedPrint;
use Scalar::Util qw(weaken);
use Encode qw(decode);
use Text::Markdown ();
use HTTP::Date qw( time2isoz );
use Time::Piece;
#use 5.016; # for fc
lib/Mail/Email/IMAP.pm view on Meta::CPAN
} => $class;
};
sub from_imap_client {
my ($package, $conn, $uid, %info) = @_;
#weaken $conn;
my $dt = $conn->date( $uid );
my $timestamp;
if( $dt ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/Auth/Extensible.pm view on Meta::CPAN
sub BUILD {
my $plugin = shift;
my $app = $plugin->app;
Scalar::Util::weaken( my $weak_plugin = $plugin );
warn "No Auth::Extensible realms configured with which to authenticate user"
unless $plugin->realm_count;
# Force all providers to load whilst we have access to the full dsl.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/BrowserDetect.pm view on Meta::CPAN
#ABSTRACT: Provides an easy to have info of the browser.
sub BUILD {
my $plugin = shift;
# Create a weakened plugin that we can close over to avoid leaking.
Scalar::Util::weaken( my $weak_plugin = $plugin );
$plugin->app->add_hook(
Dancer2::Core::Hook->new(
name => 'before_template',
code => sub {
my $tokens = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/Interchange6.pm view on Meta::CPAN
use warnings;
use Dancer2::Plugin;
use Dancer2::Plugin::Interchange6::Business::OnlinePayment;
use Module::Runtime 'use_module';
use Scalar::Util 'weaken';
=head1 NAME
Dancer2::Plugin::Interchange6 - Interchange6 Shop Plugin for Dancer2
lib/Dancer2/Plugin/Interchange6.pm view on Meta::CPAN
'shop_state',
'shop_user';
sub BUILD {
my $plugin = shift;
weaken ( my $weak_plugin = $plugin );
$plugin->app->add_hook(
Dancer2::Core::Hook->new(
name => 'before',
code => sub {
# D2PAE::Provider::DBIC returns logged_in_user as hashref
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Template/TTLogReport.pm view on Meta::CPAN
use Log::Report 'dancer2-plugin-logreport';
use Moo;
use Dancer2::Core::Types;
use Dancer2::FileUtils qw/path/;
use Scalar::Util qw/weaken/;
use Log::Report::Template ();
use Log::Report::Util qw/parse_locale/;
with 'Dancer2::Core::Role::Template';
lib/Dancer2/Template/TTLogReport.pm view on Meta::CPAN
my $charset = $self->charset;
my $templater = delete $config{templater} || 'Log::Report::Template';
$Template::Stash::PRIVATE = undef if delete $config{show_private_variables};
weaken(my $ttt = $self);
my $include_path = delete $config{include_path};
$templater->new(
ANYCASE => 1,
ABSOLUTE => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/ParamTypes.pm view on Meta::CPAN
'builder' => '_build_type_actions',
);
sub _build_type_actions {
my $self = shift;
Scalar::Util::weaken( my $plugin = $self );
return {
'error' => sub {
my ( $self, $details ) = @_;
my ( $type, $name ) = @{$details}{qw<type name>};
lib/Dancer2/Plugin/ParamTypes.pm view on Meta::CPAN
'action' => $action,
};
}
# Couldn't prove yet that this is required, but it makes sense to me
Scalar::Util::weaken( my $plugin = $self );
return sub {
my @route_args = @_;
# Hash::MultiValue has "each" method which we could use to
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Core/App.pm view on Meta::CPAN
or croak "Cannot load session engine '$value': illegal module name";
my $engine_options =
$self->_get_config_for_engine( session => $value, $config );
Scalar::Util::weaken( my $weak_self = $self );
# Note that engine options will replace the default session_dir (if provided).
return $self->_factory->create(
session => $value,
session_dir => $self->_appdir_path->child('sessions')->stringify,
lib/Dancer2/Core/App.pm view on Meta::CPAN
layout_dir => ( $config->{layout_dir} || 'layouts' ),
views => $config->{views},
charset => $config->{charset},
};
Scalar::Util::weaken( my $weak_self = $self );
return $self->_factory->create(
template => $value,
%{$engine_attrs},
postponed_hooks => $self->postponed_hooks,
lib/Dancer2/Core/App.pm view on Meta::CPAN
my $engine_options =
$self->_get_config_for_engine( serializer => $value, $config );
$engine_options->{strict_utf8} //= $config->{strict_utf8};
Scalar::Util::weaken( my $weak_self = $self );
return $self->_factory->create(
serializer => $value,
config => $engine_options,
postponed_hooks => $self->postponed_hooks,
lib/Dancer2/Core/App.pm view on Meta::CPAN
# typically this is passed in as an optimization within the
# dispatch loop but may be called elsewhere
$defined_engines ||= $self->defined_engines;
# populate request in app and all engines
$self->_set_request($request);
Scalar::Util::weaken( my $weak_request = $request );
$_->set_request( $weak_request ) for @{$defined_engines};
}
has response => (
is => 'ro',
lib/Dancer2/Core/App.pm view on Meta::CPAN
mime_type => $self->mime_type,
server_tokens => !$self->config->{'no_server_tokens'},
charset => $self->config->{charset},
strict_utf8 => $self->config->{strict_utf8},
do {
Scalar::Util::weaken( my $weak_self = $self );
log_cb => sub { $weak_self && $weak_self->log(@_) };
},
$self->has_serializer_engine
? ( serializer => $self->serializer_engine )
: (),
lib/Dancer2/Core/App.pm view on Meta::CPAN
my $self = shift;
# Hook to flush the session at the end of the request,
# this way, we're sure we flush only once per request
#
# Note: we create a weakened copy $self
# before closing over the weakened copy
# to avoid circular memory refs.
Scalar::Util::weaken(my $app = $self);
$self->add_hook(
Dancer2::Core::Hook->new(
name => 'core.app.after_request',
code => sub {
lib/Dancer2/Core/App.pm view on Meta::CPAN
# load any serializer engine config
my $engine_options =
$self->_get_config_for_engine( serializer => $type, $self->config ) || {};
$engine_options->{strict_utf8} //= $self->config->{strict_utf8};
Scalar::Util::weaken( my $weak_self = $self );
my $serializer = $self->_factory->create(
serializer => $type,
config => $engine_options,
postponed_hooks => $self->postponed_hooks,
log_cb => sub { $weak_self->log(@_) },
lib/Dancer2/Core/App.pm view on Meta::CPAN
return $responder->(
[ $res->status, $res->headers_to_array, $fh ]
);
};
Scalar::Util::weaken( my $weak_self = $self );
$response = Dancer2::Core::Response::Delayed->new(
error_cb => sub { $weak_self->logger_engine->log( warning => @_ ) },
cb => $cb,
request => $Dancer2::Core::Route::REQUEST,
lib/Dancer2/Core/App.pm view on Meta::CPAN
my ($self) = @_;
for my $position ( $self->supported_hooks ) {
my $compiled_hooks = [];
for my $hook ( @{ $self->hooks->{$position} } ) {
Scalar::Util::weaken( my $app = $self );
my $compiled = set_subname subname($hook) => sub {
# don't run the filter if halt has been used
$Dancer2::Core::Route::RESPONSE &&
$Dancer2::Core::Route::RESPONSE->is_halted
and return;
lib/Dancer2/Core/App.pm view on Meta::CPAN
1;
};
# Catch bad content causing deserialization to fail when building the request
if ( ! $request_built_successfully ) {
my $err = $@;
Scalar::Util::weaken(my $app = $self);
return Dancer2::Core::Error->new(
app => $app,
message => $err,
status => 400, # 400 Bad request (dont send again), rather than 500
charset => $self->config->{charset},
lib/Dancer2/Core/App.pm view on Meta::CPAN
return $response;
}
sub build_request {
my ( $self, $env ) = @_;
Scalar::Util::weaken( my $weak_self = $self );
# If we have an app, send the serialization engine
my $request = Dancer2::Core::Request->new(
env => $env,
is_behind_proxy => $self->settings->{'behind_proxy'} || 0,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DashProfiler/Core.pm view on Meta::CPAN
die @$ if $@ && $@ !~ /^Can't locate Hash\/Util/;
*lock_keys = sub { } if not defined &lock_keys;
}
# check for weaken support, used by ChildHandles
my $HAS_WEAKEN = eval {
require Scalar::Util;
# this will croak() if this Scalar::Util doesn't have a working weaken().
Scalar::Util::weaken( my $test = [] );
1;
};
*weaken = sub { croak "Can't weaken without Scalar::Util::weaken" }
unless $HAS_WEAKEN;
# On 2GHz OS X 10.5.2 laptop:
# sample_overhead_time = 0.000014s
lib/DashProfiler/Core.pm view on Meta::CPAN
$dbh->{Profile}->empty; # discard FETCH&STOREs etc due to connect()
for my $handles ($self->{dbi_handles_all}, $self->{dbi_handles_active}) {
# clean out any dead weakrefs
defined $handles->{$_} or delete $handles->{$_} for keys %$handles;
$handles->{$dbi_profile_name} = $dbh;
# weaken($handles->{$dbi_profile_name}) if $weakly; # not currently documented or used
}
return $dbh;
}
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
t/lib/Test/More.pm view on Meta::CPAN
use Test::More tests => $Num_Tests;
There are rare cases when you will not know beforehand how many tests
your script is going to run. In this case, you can declare that you
have no plan. (Try to avoid using this as it weakens your test.)
use Test::More qw(no_plan);
In some cases, you'll want to completely skip an entire testing script.
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/Data/Clone.xs view on Meta::CPAN
if(SvOBJECT(sv)){
sv_bless(cloned, SvSTASH(sv));
}
return SvWEAKREF(cloning) ? sv_rvweaken(cloned) : cloned;
}
/* as SV* sv_clone(SV* sv) */
SV*
Data_Clone_sv_clone(pTHX_ SV* const sv) {
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