view release on metacpan or search on metacpan
lib/Crypt/RSA.pm view on Meta::CPAN
sub new {
my ($class, %params) = @_;
my %self = (%DEFAULTS, %params);
my $self = bless \%self, $class;
$self->_storemap (%KNOWNMAP);
for (qw(ES SS PP)) {
$$self{$_} = { Name => $$self{$_} . "_$_" } unless ref $$self{$_};
$$self{lc($_)} = $self->_load ( %{$$self{$_}} );
}
$$self{keychain} = new Crypt::RSA::Key;
return bless \%self, $class;
}
sub keygen {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Extract.pm view on Meta::CPAN
&& $args{prefers} ne 'past'
&& $args{prefers} ne 'future') {
_croak "Invalid `prefers` passed to constructor: expected `nearest', `past', or `future'.";
}
my $self = bless \%args, ref($class) || $class;
return $self;
}
# This method will combine the arguments of parser->new and extract. Modify the
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
my $next = 0;
for (@config) {
next if $next++ % 2;
croak M02_usage() if /[\s\n]/;
}
$o = bless {}, $class;
$o->{INLINE}{version} = $VERSION;
$o->{API}{pkg} = $pkg;
$o->{API}{script} = $script;
$o->{API}{language_id} = $language_id;
if ($option =~ /^(FILE|BELOW)$/i or
inc/Inline.pm view on Meta::CPAN
my $next = 0;
for (@config) {
next if $next++ % 2;
croak M03_usage_bind() if /[\s\n]/;
}
$o = bless {}, $class;
$o->{INLINE}{version} = $VERSION;
$o->{API}{pkg} = $pkg;
$o->{API}{script} = $script;
$o->{API}{language_id} = $language_id;
$o->receive_code($code);
inc/Inline.pm view on Meta::CPAN
or $o->{CONFIG}{PRINT_INFO}
) {
eval "require $o->{INLINE}{ILSM_module}";
croak M05_error_eval('glue', $@) if $@;
$o->push_overrides;
bless $o, $o->{INLINE}{ILSM_module};
$o->validate(@config);
}
else {
$o->{CONFIG} = {(%{$o->{CONFIG}}, @config)};
}
inc/Inline.pm view on Meta::CPAN
ref($o) eq 'Inline'
) {
eval "require $o->{INLINE}{ILSM_module}";
croak M05_error_eval('glue', $@) if $@;
$o->push_overrides;
bless $o, $o->{INLINE}{ILSM_module};
$o->validate(@config);
}
$o->load;
$o->pop_overrides;
}
view all matches for this distribution
view release on metacpan or search on metacpan
new_md5_ctx(pTHX_ MD5_COMPAT_CTX *context, const char *sclass)
{
SV *sv = newSV(0);
SV *obj = newRV_noinc(sv);
sv_bless(obj, gv_stashpv(sclass, 0));
sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_md5, (const char *)context, 0);
#if defined(USE_ITHREADS) && defined(MGf_DUP)
SvMAGIC(sv)->mg_flags |= MGf_DUP;
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
t/ffi_raw_ptr.t view on Meta::CPAN
$shared, 'foo_new',
FFI::Raw::ptr
)->coderef;
sub new {
bless shift->SUPER::new(_foo_new());
}
*get_bar = FFI::Raw->new(
$shared, 'foo_get_bar',
FFI::Raw::int,
view all matches for this distribution
view release on metacpan or search on metacpan
my($signature, $sub) = @_;
my $ffi = _ffi($signature);
my($ret_type, @args_types) = map { $typemap{$_} } split //, $signature;
my $type = '(' . join(',', @args_types) . ')->' . $ret_type;
my $closure = $ffi->closure($sub);
bless {
addr => $ffi->cast($type => 'opaque', $closure),
sub => $sub,
closure => $closure,
}, 'FFI::Callback';
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Pegex/Base.pm view on Meta::CPAN
package Pegex::Base;
# use Mo qw'build default builder xxx import nonlazy required';
# The following line of code was produced from the previous line by
# Mo::Inline version 0.38
no warnings;my$M=__PACKAGE__.'::';*{$M.Object::new}=sub{my$c=shift;my$s=bless{@_},$c;my%n=%{$c.'::'.':E'};map{$s->{$_}=$n{$_}->()if!exists$s->{$_}}keys%n;$s};*{$M.import}=sub{import warnings;$^H|=1538;my($P,%e,%o)=caller.'::';shift;eval"no Mo::$_",&{...
our $DumpModule = 'YAML';
1;
view all matches for this distribution
view release on metacpan or search on metacpan
t/array_type.t view on Meta::CPAN
isnt $@, "";
eval q{use Lexical::Var '@foo' => \[];};
isnt $@, "";
eval q{use Lexical::Var '@foo' => \"abc";};
isnt $@, "";
eval q{use Lexical::Var '@foo' => bless(\(my$x="abc"));};
isnt $@, "";
eval q{use Lexical::Var '@foo' => \*main::wibble;};
isnt $@, "";
eval q{use Lexical::Var '@foo' => bless(\*main::wibble);};
isnt $@, "";
eval q{use Lexical::Var '@foo' => qr/xyz/;};
isnt $@, "";
eval q{use Lexical::Var '@foo' => bless(qr/xyz/);};
isnt $@, "";
eval q{use Lexical::Var '@foo' => [];};
is $@, "";
eval q{use Lexical::Var '@foo' => bless([]);};
is $@, "";
eval q{use Lexical::Var '@foo' => {};};
isnt $@, "";
eval q{use Lexical::Var '@foo' => bless({});};
isnt $@, "";
eval q{use Lexical::Var '@foo' => sub{};};
isnt $@, "";
eval q{use Lexical::Var '@foo' => bless(sub{});};
isnt $@, "";
eval q{use Lexical::Var '@foo' => []; @foo if 0;};
is $@, "";
eval q{use Lexical::Var '@foo' => bless([]); @foo if 0;};
is $@, "";
1;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Capture/Tiny.pm view on Meta::CPAN
use Carp ();
use Exporter ();
use IO::Handle ();
use File::Spec ();
use File::Temp qw/tempfile tmpnam/;
use Scalar::Util qw/reftype blessed/;
# Get PerlIO or fake it
BEGIN {
local $@;
eval { require PerlIO; PerlIO->can('get_layers') }
or *PerlIO::get_layers = sub { return () };
inc/Capture/Tiny.pm view on Meta::CPAN
unless @opts % 2 == 0;
my $stash = { capture => { @opts } };
for ( keys %{$stash->{capture}} ) {
my $fh = $stash->{capture}{$_};
Carp::confess "Custom handle for $_ must be seekable\n"
unless ref($fh) eq 'GLOB' || (blessed($fh) && $fh->isa("IO::Seekable"));
}
# save existing filehandles and setup captures
local *CT_ORIG_STDIN = *STDIN ;
local *CT_ORIG_STDOUT = *STDOUT;
local *CT_ORIG_STDERR = *STDERR;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Runtime.pm view on Meta::CPAN
# %^H state leaking into each required module, polluting the
# module's lexical state.
local %^H if _WORK_AROUND_HINT_LEAKAGE;
if(_WORK_AROUND_BROKEN_MODULE_STATE) {
my $notional_filename = &module_notional_filename;
my $guard = bless([ $notional_filename ],
"Module::Runtime::__GUARD__");
my $result = CORE::require($notional_filename);
pop @$guard;
return $result;
} else {
view all matches for this distribution
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/CreatorsAPI.pm view on Meta::CPAN
if (!$opt->{ua}) {
$opt->{ua} = HTTP::Tiny->new;
}
bless +{
credential_id => $credential_id,
credential_secret => $credential_secret,
credential_version => $credential_version,
partner_tag => $opt->{partner_tag} || '',
marketplace => $opt->{marketplace} || 'www.amazon.com',
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.pm view on Meta::CPAN
use English qw(-no_match_vars);
use HTTP::Date;
use LWP::UserAgent::Determined;
use List::Util qw( any pairs none );
use MIME::Base64 qw(encode_base64 decode_base64);
use Scalar::Util qw( reftype blessed );
use URI;
use XML::Simple;
use parent qw(Class::Accessor::Fast Exporter);
lib/Amazon/S3.pm view on Meta::CPAN
########################################################################
sub delete_public_access_block {
########################################################################
my ( $self, $bucket ) = @_;
my $bucketv2 = bless $bucket, 'Amazon::S3::BucketV2';
return $bucketv2->DeletePublicAccessBlock;
}
1;
view all matches for this distribution