view release on metacpan or search on metacpan
lib/NewRelic/Agent/FFI.pm view on Meta::CPAN
if (%args) {
require Carp;
Carp::croak("Invalid arguments: @{[ keys %args ]}");
}
bless {
license_key => $license_key,
app_name => $app_name,
app_language => $app_language,
app_language_version => $app_language_version,
}, $class;
view all matches for this distribution
view release on metacpan or search on metacpan
t/Test/Builder.pm view on Meta::CPAN
=cut
sub create {
my $class = shift;
my $self = bless {}, $class;
$self->reset;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tickit/Style.pm view on Meta::CPAN
struct Keyset => [qw( tags style )];
sub new
{
my $class = shift;
return bless [], $class;
}
sub clone
{
my $proto = shift;
return bless [ map { Keyset( $_->tags, { %{$_->style} } ) }
@$proto ], ref $proto;
}
sub add
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alter.pm view on Meta::CPAN
=head3 Basic Functions
The functions described here accept a first argument named $obj.
Despite the name, C<$obj> can be any reference, it doesn't I<have>
to be blessed (though it usually will be). It is a fatal error
if it is not a reference or if the reference points to a read-only value.
=over
=item C<ego($obj)>
lib/Alter.pm view on Meta::CPAN
package First;
use Alter qw( alter ego);
sub new {
my $class = shift;
bless( \ my $o, $class)->init( @_);
}
sub init {
my $f = shift;
alter $f, { name => shift };
lib/Alter.pm view on Meta::CPAN
package Last;
use Alter qw( alter ego);
sub new {
my $class = shift;
bless( \ my $o, $class)->init( @_);
}
sub init {
my $l = shift;
alter $l, [ shift];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/AinoDump.pm view on Meta::CPAN
my $proto=shift;
my $class=ref($proto)||$proto;
my $parent=ref($proto)&&$proto;
my $self={};
bless($self,$class);
$self->_init(@_);
$self->_set_err_state($ERR_OK);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/NLPPlatform/MyReceiver.pm view on Meta::CPAN
my @stack_elements = ();
my $tab_objet = {};
my $is_in_ann;
# my $data;
return bless {"tab_object" => {} , "stack_elements" => \@stack_elements, "is_in_ann" => $is_in_ann, "counter_id" => 0 } , $type;
}
#
# process <..>
#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Logger.pm view on Meta::CPAN
my $class = shift();
#warn("new($class): \@_ = ", join(", ", map { "'$_'" } @_), "\n");
my %options = ( level => 0, stream => \*STDERR, @_ );
$options{level} = 0 if !defined $options{level};
return bless {
options => \%options,
}, $class;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/QueryFilter.pm view on Meta::CPAN
my $proto=shift;
my $class=ref($proto)||$proto;
my $parent=ref($proto)&&$proto;
my $self={};
bless($self,$class);
$self->_set_err_state($ERR_OK);
$self->_init(@_);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Saa.pm view on Meta::CPAN
'my_addr' => $my_addr,
'err' => '',
'queue' => [],
};
bless $this, $class;
$SIG{'PIPE'} = 'IGNORE';
return $this;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alzabo/Display/SWF/Column.pm view on Meta::CPAN
$v->nextFrame;
my $self = { sprite => $v, width => $w, dy => undef, displayItem => undef,
is_primary_key => undef, is_foreign_key => undef,
foreign_keys => [] };
bless $self, $pkg;
return $self;
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alzabo/ChangeTracker.pm view on Meta::CPAN
my $class = ref $proto || $proto;
++$STACK;
my $self = $STACK;
bless \$self, $class;
}
sub add
{
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/CloudFront/Thin.pm view on Meta::CPAN
}
else {
Carp::croak "argument '$key' missing on call to new()";
}
}
bless $self, $class;
my $ua = $args->{ua} || _default_ua();
$self->ua($ua);
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/Credentials.pm view on Meta::CPAN
sub new {
my $class = shift;
my $self = $class->SUPER::new(ref($_[0]) ? $_[0] : { @_ });
unless ( $self->get_logger ) {
$self->set_logger(bless {}, 'Amazon::Credentials::Logger');
}
unless ($self->get_user_agent) {
$self->set_user_agent(new LWP::UserAgent);
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/000-report-versions.t view on Meta::CPAN
# Implementation
# Create an empty YAML::Tiny object
sub new {
my $class = shift;
bless [ @_ ], $class;
}
# Create an object from a file
sub read {
my $class = ref $_[0] ? ref shift : shift;
t/000-report-versions.t view on Meta::CPAN
}
# Create an object from a string
sub read_string {
my $class = ref $_[0] ? ref shift : shift;
my $self = bless [], $class;
my $string = $_[0];
unless ( defined $string ) {
return $self->_error("Did not provide a string to load");
}
t/000-report-versions.t view on Meta::CPAN
# Failed to load Scalar::Util
eval <<'END_PERL';
sub refaddr {
my $pkg = ref($_[0]) or return undef;
if (!!UNIVERSAL::can($_[0], 'can')) {
bless $_[0], 'Scalar::Util::Fake';
} else {
$pkg = undef;
}
"$_[0]" =~ /0x(\w+)/;
my $i = do { local $^W; hex $1 };
bless $_[0], $pkg if defined $pkg;
$i;
}
END_PERL
} else {
Scalar::Util->import('refaddr');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/DynamoDB/20120810.pm view on Meta::CPAN
sub new {
my $class = shift;
bless { @_ }, $class
}
sub implementation { shift->{implementation} }
sub host { shift->{host} }
sub port { shift->{port} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/MWS/Enumeration.pm view on Meta::CPAN
*{"${class}::import"} = *Exporter::import;
foreach my $const (@_) {
my $string = $const;
my $ref = \$string;
bless $ref, $class;
*{"${class}::$const"} = sub { $ref };
push @{"${class}::EXPORT_OK"}, $const;
push @{ ${"${class}::EXPORT_TAGS"}{'all'} }, $const;
}
lib/Amazon/MWS/Enumeration.pm view on Meta::CPAN
=head2 define ( @constants )
For each string passed, installs a class method / exportable sub into the
calling subclass by that name. The value returned by that sub will be an
object blessed into the calling package which stringifies into the constant
itself, e.g. $class->CONSTANT eq 'CONSTANT';
=head2 as_string ()
The stringifier for these enums - simply dereferences the blessed scalar.
=head1 AUTHOR
Paul Driver C<< frodwith@cpan.org >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/PAApi5/Payload.pm view on Meta::CPAN
my $class = shift;
my $partner_tag = shift or croak 'partner_tag is required';
my $marketplace = shift || 'www.amazon.com';
my $opt = shift || {};
return bless {
partner_tag => $partner_tag,
marketplace => $marketplace,
partner_type => $opt->{partner_type} || 'Associates',
}, $class;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/FastUploader.pm view on Meta::CPAN
our $VERSION = '0.08';
sub new {
my $class = shift;
my $config = shift;
bless { config => $config }, $class;
}
sub upload {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/SignedURLGenerator.pm view on Meta::CPAN
$args{prefix} ||= 'https://s3.amazonaws.com';
$args{expires} ||= 3600;
$args{prefix} =~ s/\/$//; # remove last /
return bless \%args, $class;
}
sub generate_url {
my ($self, $method, $path, $headers) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/Thin/ResponseParser.pm view on Meta::CPAN
sub new {
my ($class, %args) = @_;
my $xml = exists $args{xml} ? $args{xml} : XML::LibXML->new();
return bless {
xml => $xml,
}, $class;
}
sub _xpc {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/Thin.pm view on Meta::CPAN
delete $self->{aws_secret_access_key};
delete $self->{aws_session_token};
}
delete $self->{credential_provider};
bless $self, $class;
$self->secure(0) unless defined $self->secure;
$self->ua($self->_default_ua) unless defined $self->ua;
$self->debug(0) unless defined $self->debug;
$self->virtual_host(0) unless defined $self->virtual_host;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3.pm view on Meta::CPAN
use English qw(-no_match_vars);
use HTTP::Date;
use URI;
use LWP::UserAgent::Determined;
use MIME::Base64 qw(encode_base64 decode_base64);
use Scalar::Util qw( reftype blessed );
use List::Util qw( any pairs );
use URI::Escape qw(uri_escape_utf8);
use XML::Simple qw(XMLin); ## no critic (Community::DiscouragedModules)
use parent qw(Class::Accessor::Fast);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3Curl/PurePerl/Digest/HMAC.pm view on Meta::CPAN
{
my($class, $key, $hasher, $block_size) = @_;
$block_size ||= 64;
$key = $hasher->new->add($key)->digest if length($key) > $block_size;
my $self = bless {}, $class;
$self->{k_ipad} = $key ^ (chr(0x36) x $block_size);
$self->{k_opad} = $key ^ (chr(0x5c) x $block_size);
$self->{hasher} = $hasher->new->add($self->{k_ipad});
$self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SQS/Exception.pm view on Meta::CPAN
$self->{_requestId} = $errorInfo->{RequestId} // q{};
$self->{_xml} = $errorInfo->{XML} // q{};
$self->{_httpError} = $errorInfo->{HTTPError} // q{};
}
return bless $self, $class;
}
#
# Gets error type returned by the service if available.
#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SQS/Consumer.pm view on Meta::CPAN
sub new {
my $class = shift;
my %args = @_;
my $me = \%args;
bless $me, $class;
$me->initialize;
return $me;
}
sub initialize {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SQS/Simple/Base.pm view on Meta::CPAN
if (!$self->{UseIAMRole} && (!$self->{AWSAccessKeyId} || !$self->{SecretKey})) {
croak "Missing AWSAccessKey or SecretKey";
}
$self = bless($self, $class);
return $self;
}
sub _api_version {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SendToKindle.pm view on Meta::CPAN
smtp_port => $_[4],
smtp_user => $_[5],
smtp_password => $_[6]
};
bless $self, $class;
return $self;
}
# Sends the document.
sub send {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SimpleDB.pm view on Meta::CPAN
use constant KEEP_ALIVE_CACHESIZE => 10;
sub new {
my $class = shift;
my $args = shift || {};
my $self = bless $args, $class;
croak "No aws_access_key_id" unless $self->{aws_access_key_id};
croak "No aws_secret_access_key" unless $self->{aws_secret_access_key};
unless ($self->{agent}) {
my $agent = LWP::UserAgent->new(keep_alive => KEEP_ALIVE_CACHESIZE);
$agent->timeout(10);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ambrosia/Logger.pm view on Meta::CPAN
use File::Path;
use IO::File;
use Data::Dumper;
use Time::HiRes qw ( time );
use Scalar::Util "blessed";
use Ambrosia::error::Exceptions;
use base qw/Exporter/;
our @EXPORT = qw/logger/;
lib/Ambrosia/Logger.pm view on Meta::CPAN
_op => ( $params{-op} || '' ),
_dir => $params{-dir},
_time => {},
};
$pkg .= $key;
bless $self, $pkg;
no strict 'refs';
no warnings 'redefine';
push @{"${pkg}::ISA"}, __PACKAGE__;
lib/Ambrosia/Logger.pm view on Meta::CPAN
}
}
sub error
{
__info_ex(shift, 'ERROR: ', map { ref $_ && blessed($_) && $_->isa('Ambrosia::error::Exception::Error') ? "$_" : $_ } @_);
}
sub log
{
my ($self, @msg) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
Amethyst/Brain.pm view on Meta::CPAN
use POE;
sub new {
my $class = shift;
my $self = ($#_ == 0) ? { %{ (shift) } } : { @_ };
return bless $self, $class;
}
sub init {
my ($self) = @_;
# Not overriding this is not fatal.
view all matches for this distribution