view release on metacpan or search on metacpan
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
lib/Bio/MAGETAB/BaseClass.pm view on Meta::CPAN
use Moose;
use MooseX::FollowPBP;
use Carp;
use Scalar::Util qw(weaken);
use MooseX::Types::Moose qw( Str );
has 'authority' => ( is => 'rw',
isa => Str,
lib/Bio/MAGETAB/BaseClass.pm view on Meta::CPAN
if ( blessed $self eq __PACKAGE__ ) {
confess("ERROR: Attempt to instantiate abstract class " . __PACKAGE__);
}
if ( my $container = __PACKAGE__->get_ClassContainer() ) {
weaken $self;
$container->add_objects( $self );
}
return;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/MUST/Core/SeqId.pm view on Meta::CPAN
return $instance_for{$key} if defined $instance_for{$key};
# create a new instance
my $instance = $class->new(%args);
$instance_for{$key} = $instance;
# Note: do not weaken reference or this will defeat the purpose.
# However, this could lead to memory leak in some extreme cases.
# Scalar::Util::weaken $instance_for{$key};
return $instance;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Phylo.pm view on Meta::CPAN
use warnings;
use Bio::PhyloRole;
use base 'Bio::PhyloRole';
# don't use Scalar::Util::looks_like_number directly, use wrapped version
use Scalar::Util qw'weaken blessed';
use Bio::Phylo::Util::CONSTANT '/looks_like/';
use Bio::Phylo::Util::IDPool; # creates unique object IDs
use Bio::Phylo::Util::Exceptions 'throw'; # defines exception classes and throws
use Bio::Phylo::Util::Logger; # for logging, like log4perl/log4j
use Bio::Phylo::Util::MOP; # for traversing inheritance trees
lib/Bio/Phylo.pm view on Meta::CPAN
my $self = $class->SUPER::new();
# register for get_obj_by_id
my $id = $self->get_id;
$objects{$id} = $self;
weaken( $objects{$id} );
# notify user
$logger->info("constructor called for '$class' - $id");
# processing arguments
lib/Bio/Phylo.pm view on Meta::CPAN
if ( blessed $container ) {
if ( $container->can('can_contain') ) {
if ( $container->can_contain($self) ) {
if ( $container->contains($self) ) {
$container{$id} = $container;
weaken( $container{$id} );
}
else {
throw 'ObjectMismatch' => "'$self' not in '$container'";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/RNA/BarMap/Mapping/MinMappingEntry.pm view on Meta::CPAN
use warnings;
use Moose;
use namespace::autoclean;
use Scalar::Util qw( weaken );
use Bio::RNA::BarMap::Mapping::Type;
use Bio::RNA::BarMap::Mapping::Set;
lib/Bio/RNA/BarMap/Mapping/MinMappingEntry.pm view on Meta::CPAN
predicate => 'has_to',
isa => __PACKAGE__, # another entry
);
# Always use this method to add 'from' minima. This ensures the refs
# are weakened and no memory leaks arise.
sub add_from {
my ($self, @from) = @_;
weaken $_ foreach @from; # turn into weak references
$self->_from->insert(@from);
}
sub get_from {
my ($self) = @_;
lib/Bio/RNA/BarMap/Mapping/MinMappingEntry.pm view on Meta::CPAN
=head2 $entry->add_from(@from_entries)
Adds entries to the set of source minima, i. e. those that are mapped to this
minimum. This method makes sure that the stored references are properly
weakened and no memory leaks arise.
=head2 $entry->get_from
Returns the entries of minima that are mapped to this minimum, as stored in
the source minima set.
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);
B<NOTE>: using no_plan requires a Test::Harness upgrade else it will
think everything has failed. See L<CAVEATS and NOTES>).
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);
B<NOTE>: using no_plan requires a Test::Harness upgrade else it will
think everything has failed. See L<CAVEATS and NOTES>).
view all matches for this distribution
view release on metacpan or search on metacpan
Bio/Assembly/Contig.pm view on Meta::CPAN
use strict;
use Bio::DB::SeqFeature::Store; # isa Bio::SeqFeature::CollectionI
use Bio::Seq::PrimaryQual; # isa Bio::Seq::QualI
use Scalar::Util qw(weaken);
use base qw(Bio::Root::Root Bio::Align::AlignI);
=head1 Object creator
Bio/Assembly/Contig.pm view on Meta::CPAN
$self->throw("Using non Bio::Assembly::Scaffold object when assign contig to assembly")
if (defined $assembly && ! $assembly->isa("Bio::Assembly::Scaffold"));
# We create a circular reference to a Scaffold object. It is made weak
# to prevent memory leaks.
$self->{'_assembly'} = $assembly if (defined $assembly);
weaken($self->{'_assembly'});
return $self->{'_assembly'};
}
=head2 strand
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
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/Bitcoin/Crypto/Transaction.pm view on Meta::CPAN
I<Available in the constructor>.
=head3 block
An optional instance of L<Bitcoin::Crypto::Block>. This reference is weakened.
Block may be required to do some validations when calling L</verify>.
I<Available in the constructor>.
I<writer:> C<set_block>
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
lib/Bolts/Artifact.pm view on Meta::CPAN
use Bolts::Util qw( locator_for meta_locator_for );
use Carp ();
use List::MoreUtils qw( all );
use Moose::Util::TypeConstraints;
use Safe::Isa;
use Scalar::Util qw( weaken reftype );
has init_locator => (
is => 'ro',
does => 'Bolts::Role::Locator',
view all matches for this distribution
view release on metacpan or search on metacpan
src/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
t/send_policy.t view on Meta::CPAN
use Moose;
use lib 't/lib';
#use AnyEvent;
use POE;
use Scalar::Util qw( weaken );
use Test::More tests => 16;
{
package TestBot;
use Bot::Backbone;
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/Bot/ChatBots/Role/WebHook.pm view on Meta::CPAN
{ our $VERSION = '0.014'; }
use Ouch;
use Mojo::URL;
use Log::Any qw< $log >;
use Scalar::Util qw< blessed weaken refaddr >;
use Bot::ChatBots::Weak;
use Try::Tiny;
use Moo::Role;
view all matches for this distribution
view release on metacpan or search on metacpan
Added b2Filter, b2FixtureDef::filter and tests [jtpalmer]
Added b2PolygonShape::SetAsEdge [jtpalmer]
Fixed b2JointDef::body[AB] [jtpalmer]
0.03 19/06/2011
weaken tests due to precision (t/02-b2math.t) [FROGGS]
added Alien::Box2D to configure_requires [FROGGS]
0.02 16/06/2011
using Alien::Box2D 0.103 (no cmake) [FROGGS]
Added get and set gravity [kthakore]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bread/Board/Declare/Role/Object.pm view on Meta::CPAN
grep { $_->does('Bread::Board::Service::WithClass') && $_->has_class }
$meta->get_all_services
);
for my $service ($meta->get_all_services) {
if ($service->isa('Bread::Board::Declare::BlockInjection')) {
Scalar::Util::weaken(my $weakself = $self);
my $block = $service->block;
$self->add_service(
$service->clone(
block => sub {
$block->(@_, $weakself)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bread/Board/Literal.pm view on Meta::CPAN
A literal service is one that stores a literal scalar or reference for use in
your Bread::Board.
Beware of using references in your literals as they may cause your Bread::Board
to leak memory. If this is a concern, you may want to weaken your references.
See L<Scalar::Util/weaken>.
=head1 ATTRIBUTES
=head2 C<value>
view all matches for this distribution
view release on metacpan or search on metacpan
0.05 2015-10-19 11:09:00+01:00 Europe/London
- Fixed the correct return value for commands, so checking works.
0.04 2014-11-07 10:46:31+00:00 Europe/London
- Removed weaken of tables which did very much the wrong thing
- Fixed Throwable to stop stack trace objects leaking
0.03 2014-11-06 16:20:02+00:00 Europe/London
- Weaken some internal references to prevent leaks
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Broker/Async.pm view on Meta::CPAN
package Broker::Async;
use strict;
use warnings;
use Broker::Async::Worker;
use Carp;
use Scalar::Util qw( blessed weaken );
=head1 NAME
Broker::Async - broker tasks for multiple workers
lib/Broker/Async.pm view on Meta::CPAN
$self->process_queue;
return $future;
}
sub do_worker {
weaken(my $self = shift);
my ($worker, @args) = @_;
return $worker->do(@args)->on_ready(sub{
# queue next task
$self->process_queue;
});
}
sub process_queue {
weaken(my $self = shift);
my $queue = $self->queue;
while (@$queue) {
my ($worker) = $self->available or last;
my $task = shift @$queue;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/Bitcoin.pm view on Meta::CPAN
constructor's XPUB argument.
Now you can receive online payments as outlined above, while keeping
your private key secure offline or in a hardware wallet. You should
take all precautions to ensure that your XPUB key on the server is
also safe, as its compromise can weaken your security, though it can't
in itself lead to the loss of any Bitcoin.
To make this work right you need to find the correct key to plug into
the XPUB parameter, so that the addresses generated by
Business::Bitcoin match those your wallet uses to receive payments.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/CAMT/Message.pm view on Meta::CPAN
use strict;
use warnings;
use Log::Report 'business-camt';
use Scalar::Util qw/weaken/;
use JSON ();
sub new
{ my ($class, %args) = @_;
lib/Business/CAMT/Message.pm view on Meta::CPAN
my %attrs;
$attrs{set} = $args->{set} or panic;
$attrs{version} = $args->{version} or panic;
$attrs{camt} = $args->{camt} or panic;
weaken $attrs{camt};
$self->{_attrs} = \%attrs;
$self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/CyberSource/Rule.pm view on Meta::CPAN
=head1 ATTRIBUTES
=head2 client
a weakened reference to the client, to check the clients debug state.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website
https://github.com/hostgator/business-cybersource/issues
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/DPD.pm view on Meta::CPAN
use parent qw(Class::Accessor::Fast);
use Business::DPD::DBIC;
use Business::DPD::Label;
use Carp;
use Scalar::Util 'weaken';
use DateTime;
__PACKAGE__->mk_accessors(qw(schema schema_class dbi_connect _iso7064_mod37_36_checksum_map originator_address));
=head1 NAME
lib/Business/DPD.pm view on Meta::CPAN
$self,
$options,
));
# prevent circular reference
weaken($self->originator_address->{_dpd});
}
1;
__END__
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_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