view release on metacpan or search on metacpan
lib/Apache2/JSONRPC/Session.pm view on Meta::CPAN
view all matches for this distribution
78910111213141516171;
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 release on metacpan or search on metacpan
lib/CGI/MakeItStatic.pm view on Meta::CPAN
view all matches for this distribution
1213141516171819202122$| = 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 release on metacpan or search on metacpan
corpus/dists/Perl-Critic.changes view on Meta::CPAN
view all matches for this distribution
16011602160316041605160616071608160916101611* 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:
view release on metacpan or search on metacpan
lib/CPAN/Meta/Requirements.pm view on Meta::CPAN
view all matches for this distribution
6162636465666768697071
$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 release on metacpan or search on metacpan
lib/CPAN/Meta/Feature.pm view on Meta::CPAN
view all matches for this distribution
3334353637383940414243
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 release on metacpan or search on metacpan
lib/CPAN/Mini.pm view on Meta::CPAN
view all matches for this distribution
280281282283284285286287288289
errors
=> 1,
mirrored
=> {},
log_level
=>
'info'
,
);
my
$self
=
bless
{
%defaults
,
@_
} =>
$class
;
$self
->{dirmode} =
$defaults
{dirmode}
unless
defined
$self
->{dirmode};
$self
->{recent} = {};
view release on metacpan or search on metacpan
lib/CPAN/Uploader.pm view on Meta::CPAN
view all matches for this distribution
203204205206207208209210211212213sub
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 release on metacpan or search on metacpan
lib/CWB/CQP/More/Iterator.pm view on Meta::CPAN
view all matches for this distribution
1516171819202122232425
$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 release on metacpan or search on metacpan
t/10basics.t view on Meta::CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CayleyDickson.pm view on Meta::CPAN
view all matches for this distribution
248249250251252253254255256257258
}
else
{
@pair
= (
$values
[0] ,
$values
[1] )
}
bless
[
$class
->prepare(
@pair
) ] =>
$class
;
}
#
view release on metacpan or search on metacpan
lib/Chess/960.pm view on Meta::CPAN
view all matches for this distribution
4849505152535455565758#pod
#pod =cut
sub
new {
my
(
$class
) =
@_
;
bless
{} =>
$class
;
}
#pod =method generate_position
#pod
#pod my $pos = $c960->generate_position($num);
view release on metacpan or search on metacpan
lib/Chess/PGN/Extract/Stream.pm view on Meta::CPAN
view all matches for this distribution
2122232425262728293031
$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 release on metacpan or search on metacpan
view all matches for this distribution
view release on metacpan or search on metacpan
t/CasualEntity.pm view on Meta::CPAN
view all matches for this distribution
8910111213141516sub
new {
my
$class
=
shift
;
# I don't need any checks :)
bless
{
@_
== 1 ? %{
$_
[0]} :
@_
} =>
$class
;
}
1;
view release on metacpan or search on metacpan
t/23_multi_init.t view on Meta::CPAN
view all matches for this distribution
3334353637383940414243
BEGIN {
our
@ISA
= (
'TestMRO::C'
); }
sub
new {
my
$class
=
shift
;
my
$self
= {};
bless
$self
=>
$class
;
}
}
Class::C3::initialize;
is(TestMRO::D->new->testmethod, 43,
'double-initialize works ok'
);
view release on metacpan or search on metacpan
lib/Class/DBI/Cascade/None.pm view on Meta::CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
view all matches for this distribution
10961097109810991100110111021103110411051106my
$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 release on metacpan or search on metacpan
t/lib/FOO.pm view on Meta::CPAN
view all matches for this distribution
56789101112131415
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 release on metacpan or search on metacpan
lib/Class/Lite.pm view on Meta::CPAN
view all matches for this distribution
2425262728293031323334# Passes any arguments to init().
#
sub
new {
my
$class
=
shift
;
my
$self
= {};
bless
(
$self
=>
$class
);
$self
->init(
@_
);
return
$self
;
};
## new
#=========# OBJECT METHOD
view release on metacpan or search on metacpan
lib/Class/Maker.pm view on Meta::CPAN
view all matches for this distribution
205206207208209210211212213214215sub
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 release on metacpan or search on metacpan
lib/Class/Persist/Proxy.pm view on Meta::CPAN
131132133134135136137138139140
}
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
view all matches for this distribution
156157158159160161162163164165166
if
(
$owner
) {
$self
->owner(
$owner
);
}
$self
->real_id(
$obj
->oid );
$obj
->_duplicate_from(
$self
);
bless
$obj
=>
$class
;
}
sub
AUTOLOAD {
my
$self
=
shift
;
view release on metacpan or search on metacpan
lib/Class/Sniff.pm view on Meta::CPAN
view all matches for this distribution
631632633634635636637638639640would 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 release on metacpan or search on metacpan
XS/Array.xs view on Meta::CPAN
view all matches for this distribution
167168169170171172173174175176177
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
*/
PUSHs(sv_2mortal(obj));
void
newxs_getter(namesv,
index
)
view release on metacpan or search on metacpan
lib/Collection/Categorized.pm view on Meta::CPAN
view all matches for this distribution
99100101102103104105106107108109
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 release on metacpan or search on metacpan
view all matches for this distribution
56575859606162
$self
->{_rgb_map}->{
lc
(
$name
) } = [
$r
,
$g
,
$b
];
}
close
(RGB) or croak
"$self->{rgb_txt}: $!"
;
return
bless
$self
=>
$class
;
}
view release on metacpan or search on metacpan
lib/Conan/Configure/Xen.pm view on Meta::CPAN
view all matches for this distribution
4546474849505152535455
$self
->{settings}->{postboot},
$self
->{settings}->{name} ||
$self
->{name};
};
}
bless
$args
=>
$class
;
}
sub
generate {
my
$self
=
shift
;
view release on metacpan or search on metacpan
lib/Config/FromHash.pm view on Meta::CPAN
view all matches for this distribution
47484950515253545556}
else
{
$args
{
'environments'
} = [
undef
];
}
my
$self
=
bless
\
%args
=>
$class
;
Hash::Merge::set_behavior(
'LEFT_PRECEDENT'
);
if
(
scalar
@{
$args
{
'filenames'
} }) {
view release on metacpan or search on metacpan
lib/Config/INI/Reader.pm view on Meta::CPAN
view all matches for this distribution
294295296297298299300301302303304sub
new {
my
(
$class
) =
@_
;
my
$self
= {
data
=> {}, };
bless
$self
=>
$class
;
}
#pod =head1 ORIGIN
#pod
#pod Originaly derived from L<Config::Tiny>, by Adam Kennedy.
view release on metacpan or search on metacpan
ReadAndCheck.pm view on Meta::CPAN
view all matches for this distribution
149150151152153154155156157158159
$self
->{
'Params'
} = &{
$CheckParams
}(
$Config
{
'Params'
})
or
return
;
Reset(
$self
);
return
bless
$self
=>
$class
;
};
sub
Result($)
{
my
(
$self
) =
@_
;
view release on metacpan or search on metacpan
lib/Config/Singleton.pm view on Meta::CPAN
view all matches for this distribution
189190191192193194195196197198199my
(
$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},