view release on metacpan or search on metacpan
FuzzyInference.pm view on Meta::CPAN
view all matches for this distribution
6364656667686970717273sub
new {
my
$self
=
shift
;
my
$class
=
ref
(
$self
) ||
$self
;
my
$obj
=
bless
{} =>
$class
;
$obj
->_init;
return
$obj
;
}
view release on metacpan or search on metacpan
lib/API/GitForge/Role/GitForge.pm view on Meta::CPAN
view all matches for this distribution
3334353637383940414243
my
(
$class
,
%opts
) =
@_
;
croak
"need domain!"
unless
exists
$opts
{domain};
my
%attrs
= (
_domain
=>
$opts
{domain});
$attrs
{_access_token} =
$opts
{access_token}
if
exists
$opts
{access_token};
my
$self
=
bless
\
%attrs
=>
$class
;
$self
->_make_api;
return
$self
;
}
view release on metacpan or search on metacpan
lib/Acme/Chef.pm view on Meta::CPAN
view all matches for this distribution
7879808182838485868788my
$code
=
shift
;
defined
$code
or croak
"compile takes one argument: a code string."
;
my
$self
= {};
bless
$self
=>
$class
;
my
@paragraphs
=
$self
->_get_paragraphs(
$code
);
my
@recipes
=
$self
->_paragraphsToRecipes(\
@paragraphs
);
$_
->compile()
foreach
@recipes
;
view release on metacpan or search on metacpan
lib/Acme/Perl/Consensual.pm view on Meta::CPAN
view all matches for this distribution
106107108109110111112113114115116
my
(
$class
,
%args
) =
@_
;
$args
{locale} =
$ENV
{LC_ALL} ||
$ENV
{LC_LEGAL} ||
'en_XX.UTF-8'
unless
exists
$args
{locale};
$args
{locale} = $1
if
$args
{locale} =~ /^.._(.+?)(\.|$)/;
bless
\
%args
=>
$class
;
}
sub
locale
{
lc
shift
->{locale};
view release on metacpan or search on metacpan
lib/Acme/Teddy.pm view on Meta::CPAN
view all matches for this distribution
75767778798081828384#
sub
new {
my
$class
=
shift
;
my
$self
=
shift
|| {};
# default: hashref
bless
(
$self
=>
$class
);
$self
->init(
@_
);
return
$self
;
};
## new
view release on metacpan or search on metacpan
lib/ActiveRecord/Simple/Find.pm view on Meta::CPAN
view all matches for this distribution
1718192021222324252627sub
new {
my
(
$self_class
,
$class
,
@param
) =
@_
;
#my $self = $class->new();
my
$self
=
bless
{
class
=>
$class
} =>
$self_class
;
my
$table_name
= (
$self
->{class}->can(
'_get_table_name'
)) ?
$self
->{class}->_get_table_name :
undef
;
my
$pkey
= (
$self
->{class}->can(
'_get_primary_key'
)) ?
$self
->{class}->_get_primary_key :
undef
;
croak
'can not get table_name for class '
.
$self
->{class}
unless
$table_name
;
view release on metacpan or search on metacpan
lib/Algorithm/IncludeExclude.pm view on Meta::CPAN
view all matches for this distribution
152153154155156157158159160161162
my
$class
=
shift
;
my
$args
=
shift
|| {};
$args
->{
join
} ||=
''
;
# avoid warnings
$args
->{regexes} = {};
my
$self
= [
undef
, {},
$args
];
return
bless
$self
=>
$class
;
}
# walks down the tree and sets the value of path to value
sub
_set {
my
$tree
=
shift
;
view release on metacpan or search on metacpan
lib/Algorithm/LibLinear/DataSet.pm view on Meta::CPAN
view all matches for this distribution
1213141516171819202122sub
new {
args
my
$class
=> ClassName,
my
$data_set
=> ArrayRef[FeatureWithLabel];
bless
+{
data_set
=>
$data_set
} =>
$class
;
}
sub
load {
args
my
$class
=> ClassName,
view release on metacpan or search on metacpan
lib/CPAN/Uploader.pm view on Meta::CPAN
view all matches for this distribution
150151152153154155156157158159160sub
new {
my
(
$class
,
$arg
) =
@_
;
$arg
->{
$_
} or Carp::croak(
"missing $_ argument"
)
for
qw(user password)
;
bless
$arg
=>
$class
;
}
=method read_config_file
my $config = CPAN::Uploader->read_config_file( $filename );
view release on metacpan or search on metacpan
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
view all matches for this distribution
119120121122123124125126127128129
'apps'
=> {},
# legacy, no worries.
'apps-roundabout-way'
=>
undef
,
};
bless
$self
=>
$class
;
# this will read configuration and create confighash,
# make logger, verbosity,
# instantiate any objects we need here etc.
if
(
$self
->init(
$params
) ){
STDERR __PACKAGE__.
"${whoami} (via $parent), line "
.__LINE__.
" : error, call to init() has failed.\n"
;
return
undef
}
view release on metacpan or search on metacpan
lib/Aniki/Row/Joined.pm view on Meta::CPAN
view all matches for this distribution
7891011121314151617sub
new {
my
(
$class
,
@rows
) =
@_
;
my
%rows
=
map
{
$_
->
table_name
=>
$_
}
@rows
;
return
bless
\
%rows
=>
$class
;
}
sub
can {
my
(
$invocant
,
$method
) =
@_
;
my
$code
=
$invocant
->SUPER::can(
$method
);
view release on metacpan or search on metacpan
lib/AntTweakBar.pm view on Meta::CPAN
view all matches for this distribution
186187188189190191192193194195196
unless
defined
$name
;
my
$self
= {
_name
=>
$name
,
_bar_ptr
=> _create(
$name
),
};
bless
$self
=>
$class
;
$self
->set_bar_params(
%bar_params
);
return
$self
;
}
sub
DESTROY {
view release on metacpan or search on metacpan
lib/AnyEvent/Beanstalk/Worker.pm view on Meta::CPAN
view all matches for this distribution
1112131415161718192021our
$VERSION
=
'0.05'
;
sub
new {
my
$class
=
shift
;
my
$self
= {};
bless
$self
=>
$class
;
my
%args
=
@_
;
$self
->{_cb} = {};
$self
->{_event} = {};
view release on metacpan or search on metacpan
lib/AnyEvent/CouchDB.pm view on Meta::CPAN
view all matches for this distribution
123124125126127128129130131132133}
sub
new {
my
(
$class
,
$uri
) =
@_
;
my
$self
=
bless
{
uri
=> URI->new(
$uri
) } =>
$class
;
if
(
my
$userinfo
=
$self
->{uri}->userinfo) {
my
$auth
= encode_base64(
$userinfo
,
''
);
$self
->{http_auth} =
"Basic $auth"
;
}
return
$self
;
view release on metacpan or search on metacpan
lib/AnyEvent/I3.pm view on Meta::CPAN
view all matches for this distribution
195196197198199200201202203204205
my
$home
= (
getpwuid
($<))[7];
confess
"Could not get home directory"
unless
$home
and -d
$home
;
$path
=~ s/~/
$home
/g;
}
bless
{
path
=>
$path
} =>
$class
;
}
=head2 $i3->connect
Establishes the connection to i3. Returns an C<AnyEvent::CondVar> which will
view release on metacpan or search on metacpan
lib/AnyEvent/Sway.pm view on Meta::CPAN
view all matches for this distribution
198199200201202203204205206207208
my
$home
= (
getpwuid
($<))[7];
confess
"Could not get home directory"
unless
$home
and -d
$home
;
$path
=~ s/~/
$home
/g;
}
bless
{
path
=>
$path
} =>
$class
;
}
=head2 $sway->connect
Establishes the connection to Sway. Returns an C<AnyEvent::CondVar> which will
view release on metacpan or search on metacpan
view all matches for this distribution
1011121314151617181920{
no
warnings
'redefine'
;
sub
new {
my
$class
=
shift
;
bless
{
@_
} =>
$class
;
}
sub
content_type {
shift
->{content_type} }
sub
uri {
shift
->{uri} }
sub
args {
shift
->{args} }
sub
header_out {
view release on metacpan or search on metacpan
view all matches for this distribution
779780781782783784785786787788789790sub
_rebless {
my
$dbh
=
shift
;
my
(
$outer
,
$inner
) = DBI::_handles(
$dbh
);
my
$class
=
shift
(
@_
).
'::db'
;
bless
$inner
=>
$class
;
bless
$outer
=>
$class
;
# outer last for return
}
sub
_set_isa {
my
(
$classes
,
$topclass
) =
@_
;
view release on metacpan or search on metacpan
lib/Apache2/API/Query.pm view on Meta::CPAN
view all matches for this distribution
111112113114115116117118119120121
}
$new
=
$self
;
}
else
{
$new
=
bless
(
$hash
=>
$class
);
}
CORE::
return
(
$new
);
}
1;
view release on metacpan or search on metacpan
t/SSITest.pm view on Meta::CPAN
view all matches for this distribution
2021222324252627282930{
my
(
$class
,
$r
) =
@_
;
$r
->log_error(
"${class}: Received request for uri \""
,
$r
->uri,
"\" matching file \""
,
$r
->filename,
"\"."
);
my
$uri
= APR::URI->parse(
$r
->pool,
$r
->uri );
my
$path
= [
split
(
'/'
,
$uri
->path )]->[-1];
my
$self
=
bless
( {
apache_request
=>
$r
,
debug
=>
int
(
$r
->dir_config(
'Apache2_SSI_DEBUG'
) ) } =>
$class
);
my
$code
=
$self
->can(
$path
);
if
( !
defined
(
$code
) )
{
$r
->log_error(
"No method \"$path\" for SSI testing."
);
return
( Apache2::Const::DECLINED );
view release on metacpan or search on metacpan
lib/App/Addex/AddressBook/Abook.pm view on Meta::CPAN
view all matches for this distribution
4445464748495051525354#pod =cut
sub
new {
my
(
$class
,
$arg
) =
@_
;
my
$self
=
bless
{} =>
$class
;
$arg
->{filename} ||= File::Spec->catfile(
File::HomeDir->my_home,
'.abook'
,
'addressbook'
,
view release on metacpan or search on metacpan
lib/App/Addex.pm view on Meta::CPAN
view all matches for this distribution
4748495051525354555657sub
mvp_multivalue_args {
qw(output plugin)
}
sub
new {
my
(
$class
,
$arg
) =
@_
;
my
$self
=
bless
{} =>
$class
;
# XXX: keep track of seen/unseen classes; carp if some go unused?
# -- rjbs, 2007-04-06
for
my
$core
(
qw(addressbook)
) {
view release on metacpan or search on metacpan
lib/App/Benchmark/Accessors.pm view on Meta::CPAN
view all matches for this distribution
101102103104105106107108109110111112113114115116117118119120package
# hide from PAUSE
WithClassXSAccessor;
sub
new {
my
$class
=
shift
;
bless
{
@_
} =>
$class
;
}
package
# hide from PAUSE
WithClassXSAccessorArray;
sub
new {
my
$class
=
shift
;
my
%args
=
@_
;
bless
[
$args
{myattr} ] =>
$class
;
}
package
# hide from PAUSE
WithObjectTinyXS;
view release on metacpan or search on metacpan
lib/App/Cmd/Command.pm view on Meta::CPAN
view all matches for this distribution
5354555657585960616263#pod
#pod =cut
sub
new {
my
(
$class
,
$arg
) =
@_
;
bless
$arg
=>
$class
;
}
#pod =method execute
#pod
#pod $command_plugin->execute(\%opt, \@args);
view release on metacpan or search on metacpan
lib/App/Cronjob.pm view on Meta::CPAN
view all matches for this distribution
265266267268269270271272273274{
sub
new {
my
(
$class
,
$type
,
$text
,
$extra
) =
@_
;
bless
{
type
=>
$type
,
text
=>
$text
,
extra
=>
$extra
} =>
$class
;
}
}
1;
view release on metacpan or search on metacpan
lib/App/Grepl/Base.pm view on Meta::CPAN
view all matches for this distribution
4243444546474849505152
my
$reftype
= reftype
$arg_for
||
'SCALAR'
;
unless
(
'HASH'
eq
$reftype
) {
$class
->_croak(
"Argument to new must be a hashref, not a ($reftype)"
);
}
my
$self
=
bless
{} =>
$class
;
$self
->_initialize(
$arg_for
);
return
$self
;
}
sub
_croak {
view release on metacpan or search on metacpan
lib/App/Physics/ParticleMotion.pm view on Meta::CPAN
view all matches for this distribution
252627282930313233
my
$self
= {
run
=> 0,
config
=> Config::Tiny->new(),
};
bless
$self
=>
$class
;
return
$self
;
}
view release on metacpan or search on metacpan
lib/App/SimpleBackuper/DB/BaseTable.pm view on Meta::CPAN
view all matches for this distribution
910111213141516171819
my
(
$class
,
$number_of_records
) =
@_
;
$number_of_records
//= 0;
my
@arr
= (
undef
) x
$number_of_records
;
return
bless
\
@arr
=>
$class
;
}
sub
find_row {
my
$self
=
shift
;
my
(
$from
,
$to
) =
$self
->_find(
@_
);
view release on metacpan or search on metacpan
lib/App/TaskBuilder.pm view on Meta::CPAN
view all matches for this distribution
1819202122232425262728}
BEGIN { _accessor(
$_
)
for
qw(name require include version output)
}
sub
new {
my
$class
=
shift
;
my
$self
=
bless
{
@_
} =>
$class
;
$self
->{output} ||=
$self
->vars->{dist_vname} .
".tar.gz"
;
%{
$self
->
require
} = (
(
map
{
my
%r
= %{
do
(
$_
) ||
die
$@ };
(