Result:
found more than 1074 distributions - search limited to the first 2001 files matching your query ( run in 0.489 )


Class-Publisher

 view release on metacpan or  search on metacpan

lib/Class/Publisher.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
# $Id: Publisher.pm,v 1.3 2005/03/25 13:20:21 simonflack Exp $
use strict;
use Carp;
use Scalar::Util qw/blessed reftype weaken/;
use vars '$VERSION';
 
$VERSION = '0.2';
my (%S, %P) = ();

lib/Class/Publisher.pm  view on Meta::CPAN

17
18
19
20
21
22
23
24
25
26
27
$event = '*' unless defined $event && length $event;
croak "Invalid subscriber - $subscriber, expected a coderef, object or class name"
    unless _valid_subscriber($subscriber);
 
my $subscriber_list = $S {$item} {$event} ||= {};
weaken($subscriber) if blessed($subscriber);
my $new_subscriber;
if ($use_method && (!ref $subscriber || blessed($subscriber))) {
    $new_subscriber = [ $subscriber, $use_method ];
} else {
    $new_subscriber = $subscriber;

 view all matches for this distribution


Class-Spiffy

 view release on metacpan or  search on metacpan

lib/Class/Spiffy.pm  view on Meta::CPAN

139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
      "  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 {

lib/Class/Spiffy.pm  view on Meta::CPAN

162
163
164
165
166
167
168
169
170
171
172
    local *paired_arguments = sub { (qw(-package -init)) };
    Class::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 )

lib/Class/Spiffy.pm  view on Meta::CPAN

182
183
184
185
186
187
188
189
190
191
192
}
$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


Class-StateMachine-Declarative

 view release on metacpan or  search on metacpan

lib/Class/StateMachine/Declarative/Builder.pm  view on Meta::CPAN

409
410
411
412
413
414
415
416
417
418
                  on => {},
                  ignore => [],
                  delay => [] };
    bless $state, $class;
    push @{$parent->{substates}}, $state if $parent;
    Scalar::Util::weaken($state->{parent});
    $state;
}
 
1;

 view all matches for this distribution


Class-Std-Slots

 view release on metacpan or  search on metacpan

lib/Class/Std/Slots.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
 
use strict;
use Carp;
use Scalar::Util qw(blessed refaddr weaken);
 
our $VERSION = '0.31';
 
my %signal_map  = ();   # maps id -> signame -> array of connected slots
my %signal_busy = ();   # maps id -> signame -> busy flag

lib/Class/Std/Slots.pm  view on Meta::CPAN

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
my $caller  = ref( $src_obj );
 
_check_signals_exist( $caller, $sig_names )
 unless $options->{undeclared};
 
my $weaken = !( $options->{strong} || ref( $dst_obj ) eq 'CODE' );
for my $sig_name ( @{$sig_names} ) {
 
  # Stash the object and method so we can call it later.
  my $dst_data = [ $dst_obj, $dst_method, $options ];
  weaken( $dst_data->[0] ) if $weaken;
  push @{ $signal_map{$src_id}->{$sig_name} }, $dst_data;
}
 
# Now badness: we replace the DESTROY that Class::Std dropped into
# the caller's namespace with our own. See the note under BUGS AND

lib/Class/Std/Slots.pm  view on Meta::CPAN

672
673
674
675
676
677
678
679
680
681
682
683
Modify slot arg list to include a hash that describes the source of the signal.
 
=item strong
 
Normally the reference to the object containing the slot method is weakened (by
calling C<Scalar::Util::weaken> on it). Set this option to make the reference
strong - which means that once an object has been connected to no other
references to it need be kept.
 
Anonymous subroutine slots are always strongly referred to - so there is no
need to specify the C<strong> option for them.

 view all matches for this distribution


Class-Usul

 view release on metacpan or  search on metacpan

lib/Class/Usul/IPC/Cmd.pm  view on Meta::CPAN

20
21
22
23
24
25
26
27
28
29
use Module::Load::Conditional qw( can_load );
use POSIX                     qw( _exit setsid sysconf WIFEXITED WNOHANG );
use Scalar::Util              qw( blessed openhandle weaken );
use Socket                    qw( AF_UNIX SOCK_STREAM PF_UNSPEC );
use Sub::Install              qw( install_sub );
use Unexpected::Functions     qw( TimeOut Unspecified );

lib/Class/Usul/IPC/Cmd.pm  view on Meta::CPAN

322
323
324
325
326
327
328
329
330
331
332
my ($self, $cmd_ref, @cmd_args) = @_;
 
if ($self->async) {
   is_coderef $cmd_ref->[ 0 ] and $cmd_ref = $cmd_ref->[ 0 ];
 
   my $pidfile = $self->pidfile; weaken( $pidfile );
   my $h = IPC::Run::harness( $cmd_ref, @cmd_args, init => sub {
      IPC::Run::close_terminal(); $pidfile->println( $PID ) }, '&' );
 
   $h->start; return ( 0, $h );
}

 view all matches for this distribution


Class-Variable

 view release on metacpan or  search on metacpan

lib/Class/Variable.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
use 5.008;
use strict; use warnings FATAL => 'all';
use Exporter 'import';
use Carp;
use Scalar::Util 'weaken';
 
our $VERSION = '1.002'; # <== update version in pod
 
our @EXPORT;

lib/Class/Variable.pm  view on Meta::CPAN

60
61
62
63
64
65
66
67
68
69
70
        )
        {
            $NS->{$self} = {
                ' self' => $self
            };
            weaken $NS->{$self}->{' self'};
        }
         
        $NS->{$self}->{$name};
    };
}

lib/Class/Variable.pm  view on Meta::CPAN

82
83
84
85
86
87
88
89
90
91
92
)
{
    $NS->{$self} = {
        ' self' => $self
    };
    weaken $NS->{$self}->{' self'};
}
 
croak sprintf(
    "Access violation: protected variable %s of %s available only to class or subclasses, but not %s."
    , $name || 'undefined'

lib/Class/Variable.pm  view on Meta::CPAN

110
111
112
113
114
115
116
117
118
119
120
)
{
    $NS->{$self} = {
        ' self' => $self
    };
    weaken $NS->{$self}->{' self'};
}
 
croak sprintf(
    "Access violation: private variable %s of %s available only to class itself, not %s."
    , $name || 'undefined'

 view all matches for this distribution


Class-WeakSingleton

 view release on metacpan or  search on metacpan

lib/Class/WeakSingleton.pm  view on Meta::CPAN

72
73
74
75
76
77
78
79
80
81
returns an undefined value then the constructer is deemed to have
failed.
 
=cut
 
use Scalar::Util 'weaken';
 
sub instance {
 
    # instance()

lib/Class/WeakSingleton.pm  view on Meta::CPAN

91
92
93
94
95
96
97
98
99
100
101
    return $$instance if defined $$instance;
 
    my $new_instance = $$instance = $class->_new_instance(@_);
 
    weaken $$instance;
 
    return $new_instance;
}
 
=item $singleton = YourClass->_new_instance(...)

 view all matches for this distribution


Class-XSAccessor

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
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


Class-XSConstructor

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
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


Clone-AsUTF8Bytes

 view release on metacpan or  search on metacpan

AsUTF8Bytes.xs  view on Meta::CPAN

317
318
319
320
321
322
323
324
325
326
327
    if (sv_isobject (ref))
    {
        sv_bless (clone, SvSTASH (SvRV (ref)));
    }
    if (SvWEAKREF(ref)) {
        sv_rvweaken(clone);
    }
  }
 
TRACEME(("clone = 0x%x(%d)\n", clone, SvREFCNT(clone)));
return clone;

 view all matches for this distribution


Clone-Closure

 view release on metacpan or  search on metacpan

lib/Clone/Closure.pm  view on Meta::CPAN

118
119
120
121
122
123
124
125
126
127
128
refers to, and if there are no strong refs to this new object it will
self-destruct before C<clone> returns. For example,
 
    my $sv  = 5;
    my $ref = \$sv;
    weaken $ref;
    my $clone = clone $ref;
 
will result in $clone being C<undef>, as the new clone of $sv has no
(strong) referents. As weakrefs are normally used to break loops in
self-referential structures, this should not happen often.

 view all matches for this distribution


Clone

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

64
65
66
67
68
69
70
71
72
73
74
0.32  2012-11-22 12:14:07  garu
  - Stop skipping SvROK handling for all magical scalars. This fixes
    RT issues 67105, 79730 and 80201 (FLORA).
  - making the Changes file compliant to the CPAN::Changes spec (GARU).
  - Fixing tests when Scalar::Util::weaken is not available. As a
    result, tests should now pass even in odd OpenBSD versions (GARU).
  - removed dubious documentation on the optional parameter until
    it is 'fixed'. Right now it just increases the refcount when it's 0,
    and clones otherwise (which isn't exactly what it says). This
    fixes RT issue 57773 (GARU).

Changes  view on Meta::CPAN

139
140
141
142
143
144
145
146
147
148
149
0.17  2005-05-05 22:26:01  ray
  - Changed PERL_MAGIC_backref to '<' for compatability with 5.6
 
0.16  2005-04-20 15:49:35  ray
  - Bug fix for id 11997, "Clone dies horribly when Scalar::Util::weaken
    for details.
 
0.15.2.1  2005-05-05 21:55:30  ray
  - changed PERL_MAGIC_backref to '<' for backward compatibility with 5.6

 view all matches for this distribution


Closure-Explicit

 view release on metacpan or  search on metacpan

lib/Closure/Explicit.pm  view on Meta::CPAN

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
};
 # This will not raise the exception because $self is whitelisted
 my $code = callback {
   $self->method;
 } [qw($self)];
 # This will wrap the coderef so we can pass a weakened copy of $self
 my $code = callback {
   my $self = shift;
   $self->method;
 } weaken => [qw($self)];
 
=head1 DESCRIPTION
 
Attempts to provide some very basic protection against unintentional
capturing of lexicals in a closure.

lib/Closure/Explicit.pm  view on Meta::CPAN

77
78
79
80
81
82
83
84
85
86
87
our @EXPORT_OK = qw(callback);
 
# This is not documented, because turning it off will break
# the weaken behaviour.
use constant CLOSURE_CHECKS => exists($ENV{PERL_CLOSURE_EXPLICIT_CHECKS}) ? $ENV{PERL_CLOSURE_EXPLICIT_CHECKS} : 1;
 
=head1 EXPORTS
 
=cut

lib/Closure/Explicit.pm  view on Meta::CPAN

104
105
106
107
108
109
110
111
112
113
114
or a list of named parameters:
 
=over 4
 
=item * weaken => [...] - list of B<variable names> which will be copied, weakened
via L<Scalar::Util/weaken>, then prepended to the parameter list available in @_
in your code block
 
=item * allowed => [...] - list of B<variable names> to ignore if used in the code,
same behaviour as passing a single arrayref

lib/Closure/Explicit.pm  view on Meta::CPAN

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
For example, a method call might look like this:
 
 my $code = callback {
   my $self = shift;
   $self->method(@_);
 } weaken => [qw($self)];
 
although L<curry::weak> would be a much cleaner alternative there:
 
 my $code = $self->curry::weak::method;
 
You can mix C<weaken> and C<allowed>:
 
 my $x = 1;
 my $code = callback {
   shift->method(++$x);
 } weaken => [qw($self)], allowed => [qw($x)];
 
=cut
 
sub callback(&;@) {
        if(CLOSURE_CHECKS) {

lib/Closure/Explicit.pm  view on Meta::CPAN

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
                        warn "$_\n" for @err;
                        die "Had " . @err . " error(s) in closure";
                }
                return $code
        } else {
                return $_[0] unless grep $_ eq 'weaken', @_;
                my $code = shift;
                my %spec = @_;
                if($spec{weaken}) {
                        my $scope = peek_my(1);
                        my @extra = map ${ $scope->{$_} }, @{$spec{weaken}};
                        Scalar::Util::weaken($_) for @extra;
                        return sub { $code->(@extra, @_) };
                }
        }
}

lib/Closure/Explicit.pm  view on Meta::CPAN

164
165
166
167
168
169
170
171
172
173
174
but if you just want to get a list of potential problems for a coderef,
call this:
 
 my @errors = lint($code, allowed => [qw($x)]);
 
It's unlikely that the C<weaken> parameter will work when calling this
function directly - this may be fixed in a future version.
 
=cut
 
sub lint {

lib/Closure/Explicit.pm  view on Meta::CPAN

184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
        } keys %closed;
 
        # This is everything we declare in the sub
        my @lexicals = grep !exists $closed{$_}, keys %{ peek_sub $code };
 
        if($spec{weaken}) {
#               warn "weaken request: " . join ',', @{$spec{weaken}};
                my $scope = peek_my(2);
                my $real_code = $code;
                my @extra = map ${ $scope->{$_} }, @{$spec{weaken}};
                Scalar::Util::weaken($_) for @extra;
                $code = $_[0] = sub { $real_code->(@extra, @_) };
                shift;
        }
 
        # That's it for the data collection, now run the tests

 view all matches for this distribution


Cloudinary

 view release on metacpan or  search on metacpan

Cloudinary-0.16/Cloudinary-0.16/lib/Cloudinary.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
package Cloudinary;
use Mojo::Base -base;
use Mojo::Util qw(sha1_sum url_escape);
use Scalar::Util 'weaken';
 
our $VERSION = '0.16';
our (%SHORTER, %LONGER);
my @SIGNATURE_KEYS = qw(callback eager format public_id tags timestamp transformation type);

Cloudinary-0.16/Cloudinary-0.16/lib/Cloudinary.pm  view on Meta::CPAN

112
113
114
115
116
117
118
119
120
121
122
my $headers = {'Content-Type' => 'multipart/form-data'};
 
$post->{api_key}   = $self->api_key;
$post->{signature} = $self->_api_sign_request($post);
 
Scalar::Util::weaken($self);
my $tx = $self->_ua->post(
  $url, $headers,
  form => $post,
  $cb ? sub { $self->$cb($_[1]->res->json || {error => $_[1]->error || 'Unknown error'}) } : (),
);

 view all matches for this distribution


Clustericious

 view release on metacpan or  search on metacpan

lib/Clustericious/App.pm  view on Meta::CPAN

7
8
9
10
11
12
13
14
15
16
17
use Scalar::Util qw( weaken );
use File::Glob qw( bsd_glob );
use File::Path qw( mkpath );
use Carp qw( croak carp );

lib/Clustericious/App.pm  view on Meta::CPAN

24
25
26
27
28
29
30
31
32
33
34
our $VERSION = '1.29'; # VERSION
 
 
has commands => sub {
  my $commands = Clustericious::Commands->new(app => shift);
  weaken $commands->{app};
  return $commands;
};
 
 
sub startup {

 view all matches for this distribution


Cmd-Dwarf

 view release on metacpan or  search on metacpan

examples/helloworld/app/lib/Dwarf.pm  view on Meta::CPAN

10
11
12
13
14
15
16
17
18
19
20
use File::Basename 'dirname';
use File::Spec::Functions 'catfile';
use Scalar::Util qw/weaken/;
 
our $VERSION = '1.83';
 
use constant {
        BEFORE_DISPATCH    => 'before_dispatch',

examples/helloworld/app/lib/Dwarf.pm  view on Meta::CPAN

36
37
38
39
40
41
42
43
44
45
46
        $self->{config} ||= do {
                my $class = join '::', $self->namespace, 'Config';
                $class .= '::' . ucfirst $self->config_name if $self->can('config_name');
                load_class($class);
                my $config = $class->new(context => $self);
                weaken($config->{context});
                $config;
        };
}
 
sub _build_error {

examples/helloworld/app/lib/Dwarf.pm  view on Meta::CPAN

169
170
171
172
173
174
175
176
177
178
179
return $self->handle_not_found unless $controller;
Dwarf::Util::load_class($controller);
 
$self->{handler_class} = $controller;
$self->{handler} = $controller->new(context => $self);
weaken($self->{handler}->{context});
 
my $method = $self->find_method;
return $self->not_found unless $method;
 
$self->handler->init($self);

examples/helloworld/app/lib/Dwarf.pm  view on Meta::CPAN

433
434
435
436
437
438
439
440
441
442
443
                $package = $prefix . '::' . $package;
        }
 
        load_class($package);
        my $module = $package->new(context => $self, @_);
        weaken $module->{context};
        $module->init($self);
        return $module;
}
 
sub call_before_trigger {

 view all matches for this distribution


Cocoa-BatteryInfo

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
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


Cocoa-EventLoop

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
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


Cocoa-Growl

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
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


Cocoa-NetworkChange

 view release on metacpan or  search on metacpan

src/ppport.h  view on Meta::CPAN

2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
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


Code-DRY

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
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


Code-TidyAll

 view release on metacpan or  search on metacpan

lib/Code/TidyAll/Plugin.pm  view on Meta::CPAN

4
5
6
7
8
9
10
11
12
13
14
 
use Code::TidyAll::Util::Zglob qw(zglobs_to_regex);
use File::Which                qw(which);
use IPC::Run3                  qw(run3);
use Scalar::Util               qw(weaken);
use Text::Diff 1.44 qw(diff);

 view all matches for this distribution


CodeGen-Cpppp

 view release on metacpan or  search on metacpan

lib/CodeGen/Cpppp/Template.pm  view on Meta::CPAN

151
152
153
154
155
156
157
158
159
160
161
}
 
sub _gen_BUILD_method($class, $cpppp_ver, $perl, $src_filename, $src_lineno) {
   return
      "sub ${class}::BUILD(\$self, \$constructor_parameters=undef) {",
      "  Scalar::Util::weaken(\$self);",
      # Inject all the lexical functions that need to be in scope
      $class->_gen_perl_scope_functions($cpppp_ver),
      qq{# line $src_lineno "$src_filename"},
      $perl,
      "}",

lib/CodeGen/Cpppp/Template.pm  view on Meta::CPAN

229
230
231
232
233
234
235
236
237
238
      indent => $parse->{indent},
      output => CodeGen::Cpppp::Output->new,
      current_output_section => 'private',
      %attrs,
   }, $class;
   Scalar::Util::weaken($self->{context})
      if $self->{context};
   $self->BUILD(\%attrs);
   $self->flush;
}

 view all matches for this distribution


CogBase

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
      "  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

207
208
209
210
211
212
213
214
215
216
217
    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

227
228
229
230
231
232
233
234
235
236
237
}
$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


Compress-Bzip2

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
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


Compress-DSRC

 view release on metacpan or  search on metacpan

src/ppport.h  view on Meta::CPAN

2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
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


Compress-Huffman-Binary

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
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


Compress-LZ4Frame

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
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


Compress-Raw-Bzip2

 view release on metacpan or  search on metacpan

t/Test/More.pm  view on Meta::CPAN

130
131
132
133
134
135
136
137
138
139
140
  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<BUGS>)

 view all matches for this distribution


Compress-Raw-Lzma

 view release on metacpan or  search on metacpan

t/Test/More.pm  view on Meta::CPAN

130
131
132
133
134
135
136
137
138
139
140
  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<BUGS>)

 view all matches for this distribution


( run in 0.489 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )