Result:
found 556 distributions and 1058 files matching your query ! ( run in 1.955 )


CGI-JSONRPC

 view release on metacpan or  search on metacpan

lib/Apache2/JSONRPC/Session.pm  view on Meta::CPAN

7
8
9
10
11
12
13
14
15
16
17
1;
 
sub new {
   my ($class,%args) = @_;
   %args = __PACKAGE__->init_session(%args);
   return bless { dispatcher => $class->default_dispatcher, %args }, $class;
}
 
sub _generate_sid {
  my ($class,$r) = @_;
  # ok this makes me feel dirty but it's either use the id generate from

 view all matches for this distribution


CGI-MakeItStatic

 view release on metacpan or  search on metacpan

lib/CGI/MakeItStatic.pm  view on Meta::CPAN

12
13
14
15
16
17
18
19
20
21
22
$| = 1;
 
sub check{
  my($class, $q, $attr) = @_;
  my $self = {};
  bless $self => $class;
  $attr ||= {};
  $attr->{dir} or Carp::croak('usage: CGI::MakeItStatic->check($q, {dir => "data_dir"})');
  $attr->{renew_key}   ||= "renew";
  $attr->{keys}        ||= [];
  $attr->{forbid}      ||= sub {return 0};

 view all matches for this distribution


CPAN-Changes

 view release on metacpan or  search on metacpan

corpus/dists/Perl-Critic.changes  view on Meta::CPAN

1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
* 20060: Incorrect page numbers in ProhibitLeadingZeros
  and RequireNumberSeparator policies.
* 20068: .perlrc file - inconsistent documentation
* 20254: "use vars qw(@EXPORT_OK)" not recognized
* 20463: No-case heredoc terminator incorrectly detected as lower case.
* ProhibitOneArgBless doesn't understand "bless {} => $class;"
* ProhibitExcessComplexity doesn't count 'while' and 'until' stmnts
* ProhibitLeadingZeros was falsely hits '.0456'
 
Enhancements:
* If File::HomeDir is available, we use it to locate the

 view all matches for this distribution


CPAN-Meta-Requirements

 view release on metacpan or  search on metacpan

lib/CPAN/Meta/Requirements.pm  view on Meta::CPAN

61
62
63
64
65
66
67
68
69
70
71
  $options ||= {};
  Carp::croak "Argument to $class\->new() must be a hash reference"
    unless ref $options eq 'HASH';
  my %self = map {; $_ => $options->{$_}} @valid_options;
 
  return bless \%self => $class;
}
 
#pod =method add_minimum
#pod
#pod   $req->add_minimum( $module => $version );

 view all matches for this distribution


CPAN-Meta

 view release on metacpan or  search on metacpan

lib/CPAN/Meta/Feature.pm  view on Meta::CPAN

33
34
35
36
37
38
39
40
41
42
43
    identifier  => $identifier,
    description => $spec->{description},
    prereqs     => CPAN::Meta::Prereqs->new($spec->{prereqs}),
  );
 
  bless \%guts => $class;
}
 
#pod =method identifier
#pod
#pod This method returns the feature's identifier.

 view all matches for this distribution


CPAN-Mini

 view release on metacpan or  search on metacpan

lib/CPAN/Mini.pm  view on Meta::CPAN

280
281
282
283
284
285
286
287
288
289
  errors       => 1,
  mirrored     => {},
  log_level    => 'info',
);
 
my $self = bless { %defaults, @_ } => $class;
 
$self->{dirmode} = $defaults{dirmode} unless defined $self->{dirmode};
 
$self->{recent} = {};

 view all matches for this distribution


CPAN-Uploader

 view release on metacpan or  search on metacpan

lib/CPAN/Uploader.pm  view on Meta::CPAN

203
204
205
206
207
208
209
210
211
212
213
sub new {
  my ($class, $arg) = @_;
 
  $arg->{$_} or Carp::croak("missing $_ argument") for qw(user password);
  bless $arg => $class;
}
 
#pod =method read_config_file
#pod
#pod   my $config = CPAN::Uploader->read_config_file( $filename );

 view all matches for this distribution


CWB-CQP-More

 view release on metacpan or  search on metacpan

lib/CWB/CQP/More/Iterator.pm  view on Meta::CPAN

15
16
17
18
19
20
21
22
23
24
25
    $self->{size}  = $ops{size}       || 1;
 
    $self->{fname} = $self->{crp}?"$self->{crp}:$self->{name}" : $self->{name};
    $self->{limit} = $cwb->size($self->{fname}) || 0;
 
    return bless $self => $class;
}
 
sub reset {
    my $self = shift;
    $self->{pos} = 0;

 view all matches for this distribution


Catalyst-Plugin-C3

 view release on metacpan or  search on metacpan

t/10basics.t  view on Meta::CPAN

9
10
11
12
13
14
15
16
17
18
19
}
 
package C3NT::Foo;
use base qw/ https://metacpan.org/pod/Catalyst::Component">Catalyst::Component /;
 
sub new { my $class = shift; my %args = (@_); bless \%args => $class }
sub basic { return 42 }
sub c3_then_next { return 21 }
sub next_then_c3 { return 22 }
 
package C3NT::Bar;

 view all matches for this distribution


CayleyDickson

 view release on metacpan or  search on metacpan

lib/CayleyDickson.pm  view on Meta::CPAN

248
249
250
251
252
253
254
255
256
257
258
   }
   else {
      @pair = ( $values[0] ,
                $values[1] )
   }
   bless [ $class->prepare(@pair) ] => $class;
}
 
 
 
#

 view all matches for this distribution


Chess-960

 view release on metacpan or  search on metacpan

lib/Chess/960.pm  view on Meta::CPAN

48
49
50
51
52
53
54
55
56
57
58
#pod
#pod =cut
 
sub new {
  my ($class) = @_;
  bless {} => $class;
}
 
#pod =method generate_position
#pod
#pod   my $pos = $c960->generate_position($num);

 view all matches for this distribution


Chess-PGN-Extract

 view release on metacpan or  search on metacpan

lib/Chess/PGN/Extract/Stream.pm  view on Meta::CPAN

21
22
23
24
25
26
27
28
29
30
31
  $self->{pgn_file} = $pgn_file;
  open my $pgn_handle, '<', $pgn_file
    or croak ("Cannot open PGN file: \"$pgn_file\"");
  $self->{pgn_handle} = $pgn_handle;
 
  bless $self => $class;
}
 
sub pgn_file { $_[0]->{pgn_file} }
 
sub read_game {

 view all matches for this distribution


Class-Accessor-Class

 view release on metacpan or  search on metacpan

t/basic.t  view on Meta::CPAN

10
11
12
13
14
15
16
17
18
19
20
package Robot;
        @Robot::ISA = qw(Class::Accessor::Class);
        Robot->mk_class_accessors(qw(robots_online));
        Robot->robots_online(1);
 
        sub new { my $class = shift; bless {@_} => $class }
        sub do_something {
                my $self = shift;
                return $self->robots_online ? 1 : 0;
        }
package main;

 view all matches for this distribution


Class-Accessor-TrackDirty

 view release on metacpan or  search on metacpan

t/CasualEntity.pm  view on Meta::CPAN

8
9
10
11
12
13
14
15
16
sub new {
    my $class = shift;
 
    # I don't need any checks :)
    bless {@_ == 1 ? %{$_[0]} : @_} => $class;
}
 
1;

 view all matches for this distribution


Class-C3

 view release on metacpan or  search on metacpan

t/23_multi_init.t  view on Meta::CPAN

33
34
35
36
37
38
39
40
41
42
43
    BEGIN { our @ISA = ('TestMRO::C'); }
    use Class::C3;
    sub new {
        my $class = shift;
        my $self = {};
        bless $self => $class;
    }
}
 
Class::C3::initialize;
is(TestMRO::D->new->testmethod, 43, 'double-initialize works ok');

 view all matches for this distribution


Class-DBI

 view release on metacpan or  search on metacpan

lib/Class/DBI/Cascade/None.pm  view on Meta::CPAN

58
59
60
61
62
63
64
65
66
67
68
use strict;
 
sub new {
        my ($class, $rel) = @_;
        bless { _rel => $rel } => $class;
}
 
sub foreign_for {
        my ($self, $obj) = @_;
        return $self->{_rel}

 view all matches for this distribution


Class-Declare

 view release on metacpan or  search on metacpan

Declare.pm  view on Meta::CPAN

1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
my    $ref                  = \%hash;
my  ( $key )                =  ( $ref =~ m#0x([a-f\d]+)#o );
      $__OBJECTS__{ $key }  = $ref;
 
# create the new object (applying the index offset)
my  $obj   = bless \$key => $class;
 
# if there were any arguments passed, then these will be used to
# set the parameters for this object
# NB: - only public attributes may be set this way
#     - need to examine every class in the @ISA hierarchy

 view all matches for this distribution


Class-Hook

 view release on metacpan or  search on metacpan

t/lib/FOO.pm  view on Meta::CPAN

5
6
7
8
9
10
11
12
13
14
15
        my $class = shift;
        my $param = shift;
#       print "new called with ".Dumper(\@_) . "from ".caller(0)."\n";
        $self = { key1 => 'Hello there',
              key2 => $param };
        return bless $self => $class;
}
 
sub bar {
#       print "bar called with ".Dumper(\@_) . "from ".caller(0)."\n";
        my $self = shift;

 view all matches for this distribution


Class-Lite

 view release on metacpan or  search on metacpan

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

24
25
26
27
28
29
30
31
32
33
34
#   Passes any arguments to init().
#  
sub new {
    my $class   = shift;
    my $self    = {};
    bless ( $self => $class );
    $self->init(@_);
    return $self;
}; ## new
 
#=========# OBJECT METHOD

 view all matches for this distribution


Class-Maker

 view release on metacpan or  search on metacpan

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

205
206
207
208
209
210
211
212
213
214
215
sub reflect
{
        my $class = ref( $_[0] ) || $_[0] || die;
 
                my $rfx = bless name => $class  }, 'Class::Maker::Reflex';
 
                        # - First get the "${$DEFINITION}" href containing the class definition
                        # - find the functions of that class declerated with ': method'
                        # - catch up the parent class reflection if DEEP is activated
                        # - update "${$DEFINITION}"->{isa} with its real @ISA

 view all matches for this distribution


Class-Persist

 view release on metacpan or  search on metacpan

lib/Class/Persist/Proxy.pm  view on Meta::CPAN

131
132
133
134
135
136
137
138
139
140
    }
    return $self->record('Class::Persist::Error::DB::NotFound', "Could not load $class for $self", 1)
  }
 
  $self->_duplicate_from( $obj );
  bless $self => $class;
}
 
 
=head2 proxy( $obj )

lib/Class/Persist/Proxy.pm  view on Meta::CPAN

156
157
158
159
160
161
162
163
164
165
166
  if ($owner) {
    $self->owner( $owner );
  }
  $self->real_id( $obj->oid );
  $obj->_duplicate_from( $self );
  bless $obj => $class;
}
 
 
sub AUTOLOAD {
  my $self = shift;

 view all matches for this distribution


Class-Sniff

 view release on metacpan or  search on metacpan

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

631
632
633
634
635
636
637
638
639
640
would be considered 3 lines long, even though you might count it differently:
 
 sub new {
     # this is our constructor
     my ( $class, $arg_for ) = @_;
     my $self = bless {} => $class;
     return $self;
 }
 
=cut

 view all matches for this distribution


Class-XSAccessor

 view release on metacpan or  search on metacpan

XS/Array.xs  view on Meta::CPAN

167
168
169
170
171
172
173
174
175
176
177
    classname = SvROK(class) ? sv_reftype(SvRV(class), 1) : SvPV_nolen_const(class);
    array = newAV();
    obj = sv_bless( newRV_noinc((SV*)array), gv_stashpv(classname, 1) );
    /* we ignore arguments. See Class::XSAccessor's XS code for
     * how we'd use them in case of bless {@_} => $class.
     */
    PUSHs(sv_2mortal(obj));
 
void
newxs_getter(namesv, index)

 view all matches for this distribution


Collection-Categorized

 view release on metacpan or  search on metacpan

lib/Collection/Categorized.pm  view on Meta::CPAN

99
100
101
102
103
104
105
106
107
108
109
    my $action = $dispatch->{ref $ref};
    croak 'pass an ARRAY or CODE reference only' unless $action;
    $action->();
     
    $self->{_data} = {};
    return bless $self => $class;
}
 
=head2 categories
 
Returns a list of categories in use

 view all matches for this distribution


Color-Rgb

 view release on metacpan or  search on metacpan

Rgb.pm  view on Meta::CPAN

56
57
58
59
60
61
62
        $self->{_rgb_map}->{ lc($name) } = [$r, $g, $b];
    }
 
    close (RGB) or croak "$self->{rgb_txt}: $!";
 
    return bless $self => $class;
}

 view all matches for this distribution


Conan

 view release on metacpan or  search on metacpan

lib/Conan/Configure/Xen.pm  view on Meta::CPAN

45
46
47
48
49
50
51
52
53
54
55
                                $self->{settings}->{postboot},
                                $self->{settings}->{name} || $self->{name};
                };
        }
 
        bless $args => $class;
}
 
sub generate {
 
        my $self = shift;

 view all matches for this distribution


Config-FromHash

 view release on metacpan or  search on metacpan

lib/Config/FromHash.pm  view on Meta::CPAN

47
48
49
50
51
52
53
54
55
56
}
else {
    $args{'environments'} = [ undef ];
}
 
my $self = bless \%args => $class;
 
Hash::Merge::set_behavior('LEFT_PRECEDENT');
 
if(scalar @{ $args{'filenames'} }) {

 view all matches for this distribution


Config-INI

 view release on metacpan or  search on metacpan

lib/Config/INI/Reader.pm  view on Meta::CPAN

294
295
296
297
298
299
300
301
302
303
304
sub new {
  my ($class) = @_;
 
  my $self = { data => {}, };
 
  bless $self => $class;
}
 
#pod =head1 ORIGIN
#pod
#pod Originaly derived from L<Config::Tiny>, by Adam Kennedy.

 view all matches for this distribution


Config-ReadAndCheck

 view release on metacpan or  search on metacpan

ReadAndCheck.pm  view on Meta::CPAN

149
150
151
152
153
154
155
156
157
158
159
        $self->{'Params'} = &{$CheckParams}($Config{'Params'})
                or return;
 
        Reset($self);
 
        return bless $self => $class;
        };
 
sub Result($)
        {
        my ($self) = @_;

 view all matches for this distribution


Config-Singleton

 view release on metacpan or  search on metacpan

lib/Config/Singleton.pm  view on Meta::CPAN

189
190
191
192
193
194
195
196
197
198
199
my ($app_config, $arg) = @_;
 
sub {
  my ($class, $filename) = @_;
 
  my $self = bless { } => $class;
 
  $self->{basename} = $filename || $class->default_filename;
 
  $filename = $app_config->_find_file_in_path(
    $self->{basename},

 view all matches for this distribution


( run in 1.955 second using v1.01-cache-2.11-cpan-26ccb49234f )