view release on metacpan or search on metacpan
t/90-MooseX-NonMoose/001-basic.t view on Meta::CPAN
package Foo;
sub new {
my $class = shift;
bless { _class => $class }, $class;
}
package Foo::Mouse;
use Mouse;
use MouseX::Foreign qw(Foo);
view all matches for this distribution
view release on metacpan or search on metacpan
t/050-non-mop-integration/003-attributes-in-non-mop-inherited-class.t view on Meta::CPAN
use strict;
use warnings;
sub new {
my $class = shift;
bless { @_ } => $class;
}
}
{
package App;
t/050-non-mop-integration/003-attributes-in-non-mop-inherited-class.t view on Meta::CPAN
use warnings;
sub connect {
my $class = shift;
my ($dsn) = @_;
bless { dsn => $dsn } => $class;
}
sub dsn { shift->{dsn} }
}
view all matches for this distribution
view release on metacpan or search on metacpan
TableInfo.pm view on Meta::CPAN
_dbh => $dbh,
_data => [],
table_info => {},
};
bless $self => $class;
$self->_init($table);
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/CIDR/MobileJP.pm view on Meta::CPAN
};
sub new {
my ($class, $stuff) = @_;
return bless {spanner => $class->_create_spanner($class->_load_config($stuff))}, $class;
}
sub _create_spanner {
my ($class, $conf) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/CVE.pm view on Meta::CPAN
elsif (@_ == 2) {
my %p = @_;
$r{$_} = $p{$_} for keys %p;
}
}
bless \%r => $class;
} # new
sub diag {
my $self = shift or return;
ref $self or return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/DAAP/Client.pm view on Meta::CPAN
);
sub new {
my $class = shift;
my $self = bless { %Defaults } => $class;
if (@_ > 1) {
$self->_init(@_);
} elsif (@_) {
$self->{SERVER_HOST} = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/DHCP/Control/Generic.pm view on Meta::CPAN
Net::DHCP::Control::open_object($object, $handle) or return;
unless ($opts{callback}) {
Net::DHCP::Control::wait_for_completion($object) or return;
}
bless $self => $class;
}
for my $key (qw(obj kind handle opts auth class lazy)) {
my $methname = $key;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Domain/Match.pm view on Meta::CPAN
source => $SOURCE,
cache => $CACHE,
@_,
};
my $o = bless $args => $class;
unless( -e $o->{local} ){
$o->pull;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Domain/Regex.pm view on Meta::CPAN
source => $SOURCE,
cache => $CACHE,
@_,
};
my $o = bless $args => $class;
unless( -e $o->{local} ){
$o->pull;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/IMAP/Simple.pm view on Meta::CPAN
my ( $class, $server, %opts ) = @_;
## warn "use of Net::IMAP::Simple::SSL is depricated, pass use_ssl to new() instead\n"
## if $class =~ m/::SSL/;
my $self = bless { count => -1 } => $class;
$self->{use_v6} = ( $opts{use_v6} ? 1 : 0 );
$self->{use_ssl} = ( $opts{use_ssl} ? 1 : 0 );
unless( $opts{shutup_about_v6ssl} ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/IP/Match/Bin/Perl.pm view on Meta::CPAN
sub new {
my $this = shift;
my $class = ref($this) || $this;
my $self = {};
bless $self => $class;
my $tree = [];
$self->{Tree} = $tree;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/IPAddress/Util.pm view on Meta::CPAN
}
else {
return ERROR("Invalid argument `$address', a(n) " . (ref($address) || 'bare scalar') . ' provided');
}
# warn(join(',', @$normal) . "\n");
return bless { address => pack('C16', @$normal), %opt } => $class;
}
sub is_ipv4 {
my $self = shift;
my @octets = unpack 'C16', $self->{ address };
view all matches for this distribution
view release on metacpan or search on metacpan
NonBlock.pm view on Meta::CPAN
$Nest->{'SilenceT'} = (defined($Params{'SilenceT'}) ? $Params{'SilenceT'} : 0);
$Nest->{'BuffSize'} = (defined($Params{'BuffSize'}) ? $Params{'BuffSize'} : POSIX::BUFSIZ);
$Nest->{'MaxClients'} = (defined($Params{'MaxClients'}) ? $Params{'MaxClients'} : 9999999999);
$Nest->{'debug'} = (defined($Params{'debug'}) ? $Params{'debug'} : 0);
$Nest->{'class'} = $class;
return bless $Nest => $class;
};
sub newNest
{ shift; return Net::Socket::NonBlock::Nest->new(@_); };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/NetApp/Filer/TimeoutCache.pm view on Meta::CPAN
my %self = (
lifetime => $args{lifetime},
cache => {},
);
return bless \%self => $class;
}
sub STORE {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Number/RecordLocator.pm view on Meta::CPAN
=cut
sub new {
my $class = shift;
my $self = {};
bless $self => $class;
$self->init unless ($INITIALIZED);
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Number/Tolerant/Union.pm view on Meta::CPAN
#pod
#pod =cut
sub new {
my $class = shift;
bless { options => [ @_ ] } => $class;
}
#pod =head2 options
#pod
#pod This method will return a list of all the acceptable options for the union.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Number/WithError.pm view on Meta::CPAN
$num = $num->copy() if ref($num);
my $err = [];
foreach (@{$proto->{errors}}) {
push @$err, ref($_) eq 'ARRAY' ? [map {ref($_) ? $_->copy() : $_} @$_] : (ref($_) ? $_->copy() : $_)
}
return bless {num => $num, errors => $err} => $class;
}
return undef if not @_;
my $num = shift;
lib/Number/WithError.pm view on Meta::CPAN
my $errors = [];
my $self = {
num => $num,
errors => $errors,
};
bless $self => $class;
while (@_) {
my $err = shift;
if (_ARRAY($err)) {
lib/Number/WithError.pm view on Meta::CPAN
}
else {
last;
}
}
return bless { num => $num, errors => $err } => $class;
}
=head2 new_big
This is an alternative constructor for C<Number::WithError>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/OEIS/A000045.pm view on Meta::CPAN
our $VERSION = '2021041201';
my $values;
sub new ($class) {bless do {\my $v} => $class}
sub init ($self, $initial_values) {
@$values = @$initial_values;
$self
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Object/Array.pm view on Meta::CPAN
sub new {
my $class = shift;
my $real = shift || [];
my $self = bless \$real => $class;
$real{$self->_addr} = $real;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/capsule.t view on Meta::CPAN
}
our $widgetstring = "It's a widget!";
package Widget;
sub new { my $class = shift; bless { @_ } => $class }
sub size { (shift)->{size} }
sub grow { ++(shift)->{size} }
sub wane { --(shift)->{size} }
sub encapsulate { "!" }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Object/Generic.pm view on Meta::CPAN
my $false = Object::Generic::false();
sub new {
my $class = shift;
my $self = bless {} => $class;
$self->args(@_);
return $self;
}
# Return a list of the current keys.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Object/Hybrid.pm view on Meta::CPAN
fast => sub { $_[0] },
self => sub { $_[0] },
TIESCALAR => sub {
my $class = shift;
my $instance = shift || undef;
return bless \$instance => $class;
},
FETCH => sub { ${$_[0]} },
STORE => sub { ${$_[0]} = $_[1] },
});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Object/Prototype.pm view on Meta::CPAN
my $constructor = shift;
my $self = Storable::dclone($constructor);
my $id = refaddr $self;
$constructor_of{$id} = $constructor;
$prototype_of{$id} = {};
bless $self => $class;
for my $method ( keys %{ $_[0] } ) {
$self->prototype( $method, $_[0]->{$method} );
}
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PAR/Repository/Web/DataSource/MemoryCachedRepository.pm view on Meta::CPAN
my $class = shift;
my %args = @_;
my $super = $class->SUPER::new(
repositories => $args{repositories}
);
my $self = bless $super => $class;
$self->{auto_update_cache} = $args{auto_update_cache} ? 1 : 0;
$self->_init_cache();
$self->update_cache();
$self->_init_mockup_client();
view all matches for this distribution
view release on metacpan or search on metacpan
basiclib/XML/Smart/HTMLParser.pm-txt view on Meta::CPAN
sub new {
my $this = shift ;
my $class = ref($this) || $this ;
return $this if ref $this ;
$this = bless {} => $class ;
my %args = @_ ;
$this->setHandlers(%args) ;
$this->{NOENTITY} = 1 ;
view all matches for this distribution
view release on metacpan or search on metacpan
FR/perlobj.pod view on Meta::CPAN
my $self = shift;
my $class = ref($self) || $self;
my $node = {};
$node->{LEFT} = $node->{RIGHT} = $node;
$node->{DATA} = [ @_ ];
return bless $node => $class;
}
Si vous créez de tels noeuds, ils ne disparaîtront pas (actuellement)
à moins que vous ne brisiez leur auto-référence vous-même (en d'autres
termes, cela ne doit pas être considéré comme une caractéristique et
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/OpenSSH.pm view on Meta::CPAN
or croak '"options" must be a hashref';
ref $opts{'error'} eq 'HASH'
or croak '"error" must be a hashref';
return bless { _object => $class->_build_object(\%opts) }, $class;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Package/Butcher.pm view on Meta::CPAN
our $VERSION = '0.02';
sub new {
my ( $class, $arg_for ) = @_;
my $self = bless {} => $class;
return $self->_initialize($arg_for);
}
sub _initialize {
my ( $self, $arg_for ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Package/Reaper.pm view on Meta::CPAN
my ($class, $package) = @_;
# Do I care about checking $package with _CLASS and/or exists_package?
# Probably not, for now. -- rjbs, 2006-06-05
my $self = [ $package, 1 ];
bless $self => $class;
}
sub package {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pad/Tie/Plugin/List.pm view on Meta::CPAN
sub STORE_CACHE () { 4 }
# XXX this looks familiar too
sub TIEARRAY {
my ($class, $inv, $method) = @_;
bless [ $inv, $method ] => $class;
}
BEGIN {
for my $unimp (qw(STORESIZE EXISTS DELETE PUSH POP SHIFT UNSHIFT
SPLICE)) {
view all matches for this distribution