view release on metacpan or search on metacpan
lib/Data/Microformat.pm view on Meta::CPAN
$fields->{$field} = undef;
}
my $class_name = $class->class_name;
my $self = bless { _class_name => $class_name, _singulars => $singulars, %$fields, config => {%opts} }, $class;
$self->_init();
return $self;
}
sub _init
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Pagination.pm view on Meta::CPAN
# Param int $current_page Current number of page
sub new {
my ($class, $total_entries, $entries_per_page, $pages_per_set, $current_page) = @_;
my $self = bless {} => $class;
# total number of entries (>= 1) (copied from arguments)
$self->{total_entries} = $total_entries;
# number of entries per page (>= 1) (copied from arguments)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Plist.pm view on Meta::CPAN
=cut
sub new {
my $class = shift;
return bless { data => undef, @_ } => $class;
}
=head2 collapse $data
Takes an array of serialized data C<$data>. Recursively
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Polipo.pm view on Meta::CPAN
$fh->seek ($offset, SEEK_SET);
}
my $d = bless {} => $ns;
my $obj = sub {wantarray ? ($fh, $res) : $d};
bless $obj => $class;
}
sub open {
return ($_[0]->())[0];
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Rx.pm view on Meta::CPAN
prefix => { },
handler => { },
sort_keys => !!$arg->{sort_keys},
};
bless $self => $class;
$self->register_type_plugin($_) for @plugins;
$self->add_prefix($_ => $arg->{prefix}{ $_ }) for keys %{ $arg->{prefix} };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/TagHive.pm view on Meta::CPAN
#pod =cut
sub new {
my ($class) = @_;
return bless { state => {} } => $class;
}
my $tagname_re = qr{ [a-z] [-a-z0-9_]* }x;
my $tagvalue_re = qr{ [-a-z0-9_]+ }x;
my $tagpair_re = qr{ $tagname_re (?::$tagvalue_re)? }x;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Tumbler.pm view on Meta::CPAN
my %defaults = (
consumer => sub { confess "No Data::Tumbler consumer defined" },
add_path => sub { my ($path, $name ) = @_; return [ @$path, $name ] },
add_context => sub { my ($context, $value) = @_; return [ @$context, $value ] },
);
my $self = bless \%defaults => $class;
for my $attribute (qw(consumer add_path add_context)) {
next unless exists $args{$attribute};
$self->$attribute(delete $args{$attribute});
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/06_subroutine.t view on Meta::CPAN
use overload
'&{}' => 'codify',
;
sub new{
my $class = shift;
bless {@_} => $class;
}
sub codify{
my $self = shift;
$self->{code};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Moonpig.pm view on Meta::CPAN
if (@arg == 1) { return $class->from_epoch( epoch => $arg[0] ) }
my %arg = @arg;
$arg{time_zone} = 'UTC' unless exists $arg{time_zone};
bless $class->SUPER::new(%arg) => $class;
}
sub new_datetime {
my ($class, $dt) = @_;
bless $dt->clone => $class;
}
# $a is expected to be epoch seconds
sub plus {
my ($self, $a) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Declare/Args.pm view on Meta::CPAN
sub new {
my $class = shift;
my ( %args ) = @_;
my $self = bless { args => {}, default => {} } => $class;
$self->arg( $_, $args{$_} ) for keys %args;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
ex/MyModule.pm view on Meta::CPAN
@ISA = qw/ Exporter Autoloader NiceModule /;
sub new {
#This is my object oriented constructor!
my($class) = @_;
return bless {} => $class;
}
sub method1 {
my($self) = @_;
return 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Devel/Monitor.pm view on Meta::CPAN
use Scalar::Util qw(weaken isweak);
sub new {
my ($class) = @_;
my $self = {};
bless($self => $class);
return $self;
}
sub getClassB {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Devel/TrackGlobalScalar.pm view on Meta::CPAN
sub TIESCALAR {
my $class = shift;
my $instance = shift || undef;
my $name = shift;
my $o = bless [\$instance, $name] => $class;
$globals{$name} = $o;
return $o;
}
sub FETCH {
view all matches for this distribution
view release on metacpan or search on metacpan
X86/MemRegion.pm view on Meta::CPAN
use warnings;
use integer;
sub new {
my ($class, %args) = @_;
my $self = bless { } => $class;
my $mem = $args{mem};
defined $mem or $mem = "";
$self->{mem} = $mem;
$self->{len} = length($mem);
$self->{start} = $args{start} || 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dist/Man/Plugin/Template.pm view on Meta::CPAN
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->{templates} = { $self->templates };
$self->{renderer} = $self->renderer;
return bless $self => $class;
}
=head1 OBJECT METHODS
=head2 C<< templates() >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dist/Zilla/Role/ErrorLogger.pm view on Meta::CPAN
use overload '""' => sub { return "Aborting...\n"; };
sub throw {
my ( $class ) = @_;
die bless( {} => $class ); ## no critic ( RequireCarping )
};
# --------------------------------------------------------------------------------------------------
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dist/Zilla/Util/ExpandINI/Reader.pm view on Meta::CPAN
my $self = {
data => [],
sections => {},
};
bless $self => $class;
$self->{current_section} = { name => $self->starting_section, lines => [], comment_lines => [] };
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Benchmark/Dumb.pm view on Meta::CPAN
# No. Users aren't meant to create new objects at this point.
sub _new {
my $class = shift;
$class = ref($class) if ref($class);
my %args = @_;
my $self = bless {} => $class;
if (defined $args{instance}) {
my $inst = $args{instance};
$self->{name} = $inst->name;
$self->{result} = $inst->result->new;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/E/Mail/Acme.pm view on Meta::CPAN
package E'Mail::Acme::HeaderFieldValues;
our @ISA = qw(E'Mail::Acme::Base);
sub TIEARRAY {
my ($class, $name, $gutter) = @_;
bless [ $name, $gutter ] => $class;
}
sub FETCHSIZE {
my ($self) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EPUB/Parser/Util/Archive.pm view on Meta::CPAN
args(
my $class => 'ClassName',
my $data => { isa => 'Archive::Zip' },
);
bless { data => $data } => $class;
}
sub get_member_data {
args(
my $self => 'Object',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EB/Booking.pm view on Meta::CPAN
use EB::Tools::Attachments;
sub new {
my ($class) = @_;
$class = ref($class) || $class;
return bless {} => $class;
}
sub adm_open {
my ($self) = @_;
unless ( $dbh->adm_open ) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/ETests_CGI.pm view on Meta::CPAN
# ------------------------------------------------------------------------------
sub TIEHANDLE
{
my ($class, $start) = @_;
$start = 0;
return bless \$start => $class;
}
# ------------------------------------------------------------------------------
# READLINE()
# read line
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Abstract.pm view on Meta::CPAN
$foreign = Email::Simple->new($foreign)
unless Scalar::Util::blessed($foreign);
my $adapter = $class->__class_for($foreign); # dies if none available
return bless [ $foreign, $adapter ] => $class;
}
sub __class_for {
my ($self, $foreign, $method, $skip_super) = @_;
$method ||= 'handle';
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Email/Address.pm view on Meta::CPAN
sub new {
my ($class, $phrase, $email, $comment, $orig) = @_;
$phrase =~ s/\A"(.+)"\z/$1/ if $phrase;
bless [ $phrase, $email, $comment, $orig ] => $class;
}
#line 274
sub purge_cache {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Email/Address.pm view on Meta::CPAN
sub new {
my ($class, $phrase, $email, $comment, $orig) = @_;
$phrase =~ s/\A"(.+)"\z/$1/ if $phrase;
bless [ $phrase, $email, $comment, $orig ] => $class;
}
#line 274
sub purge_cache {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Address.pm view on Meta::CPAN
sub new {
my ($class, $phrase, $email, $comment, $orig) = @_;
$phrase =~ s/\A"(.+)"\z/$1/ if $phrase;
bless [ $phrase, $email, $comment, $orig ] => $class;
}
#pod =item purge_cache
#pod
#pod Email::Address->purge_cache;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/MessageID.pm view on Meta::CPAN
$args{user} ||= $class->create_user;
$args{host} ||= $class->create_host;
my $str = "$args{user}\@$args{host}";
bless \$str => $class;
}
#pod =method create_host
#pod
#pod my $domain_part = Email::MessageID->create_host;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Send.pm view on Meta::CPAN
my %plugins = map {
my ($short_name) = /^Email::Send::(.+)/;
($short_name, $_);
} $class->plugins;
$args->{_plugin_list} = \%plugins;
return bless $args => $class;
}
BEGIN {
for my $field (qw(mailer mailer_args message_modifier _plugin_list)) {
my $code = sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Simple.pm view on Meta::CPAN
Carp::carp 'Message with wide characters' if ${$text_ref} =~ /[^\x00-\xFF]/;
my ($pos, $mycrlf) = $class->_split_head_from_body($text_ref);
my $self = bless { mycrlf => $mycrlf } => $class;
my $head;
if (defined $pos) {
$head = substr $$text_ref, 0, $pos, '';
substr($head, -(length $mycrlf)) = '';
view all matches for this distribution