view release on metacpan or search on metacpan
t/lib/IPCToken.pm view on Meta::CPAN
sub new {
my ($class, $initial) = @_;
my $sem = IPC::Semaphore->new(IPC_PRIVATE, 1, S_IRUSR | S_IWUSR | IPC_CREAT);
my $obj = bless {sem => $sem} => $class;
$obj->inc($initial) if $initial;
return $obj;
}
sub inc {
view all matches for this distribution
view release on metacpan or search on metacpan
Close($self);
return;
};
};
return bless $self => $class;
};
sub emergency($$@)
{ return Message(shift, LOG_EMERG(), @_); };
sub alert($$@)
view all matches for this distribution
view release on metacpan or search on metacpan
ok(1);
package tiescalar;
sub TIESCALAR {
my ($class, $instance) = @_;
return bless \$instance => $class;
}
sub FETCH { return ${$_[0]}++ }
sub STORE { return ${$_[0]} = $_[1] }
sub DESTROY { undef ${$_[0]} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Unicode/Precis.pm view on Meta::CPAN
sub new {
my $class = shift;
my %options = @_;
bless {%options} => $class;
}
sub compare {
my $self = shift;
my $stringA = $self->enforce(shift);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Unicode/Unihan.pm view on Meta::CPAN
sub new($;){
my $class = shift;
my $dir = __FILE__; $dir =~ s/\.pm//o;
-d $dir or die "DB Directory $dir nonexistent!";
return bless { '_dir_' => $dir, @_ } => $class;
}
sub load($$){
my ($self, $name) = @_;
if ($self->{'-savemem'}){
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Unknown/Values/Instance.pm view on Meta::CPAN
confess("Attempt to coerce unknown value to a string");
}
sub new {
my $class = shift;
my $unknown = bless {} => $class;
return $unknown;
}
# this helps to prevent some infinite loops
sub bool {$CORE_UNKNOWN}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Util/Underscore/CallStackFrame.pm view on Meta::CPAN
package DB; ## no critic (ProhibitMUltiplePackages)
my @caller = CORE::caller($level + 1);
return if not @caller;
push @caller, [@DB::args]; ## no critic (ProhibitPackageVars)
return bless \@caller => $class;
}
## no critic (ProhibitBuiltinHomonyms)
sub package { shift()->[0] }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Variable/Declaration/Info.pm view on Meta::CPAN
use warnings;
sub new {
my $class = shift;
my %args = @_;
bless \%args => $class;
}
sub declaration { $_[0]->{declaration} }
sub type { $_[0]->{type} }
sub attributes { $_[0]->{attributes} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Version/Requirements.pm view on Meta::CPAN
#pod
#pod =cut
sub new {
my ($class) = @_;
return bless {} => $class;
}
sub _version_object {
my ($self, $version) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Vim/Helper/Plugin.pm view on Meta::CPAN
_gen_accessor( $caller, $_ ) for keys %config_keys;
}
sub new {
my $class = shift;
return bless {} => $class;
}
sub args { {} }
sub opts { {} }
sub vimrc { "" }
view all matches for this distribution
view release on metacpan or search on metacpan
WSDLTest.pm view on Meta::CPAN
sub new {
my $class = shift;
my $param = shift;
my $self = { 'param1' => $param->{param1},
'param2' => $param->{param2} };
return bless $self => $class;
}
# test1($msg)
#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WSRF/Lite.pm view on Meta::CPAN
ref $_[1] ? return $_[1]
: Carp::croak $_[0]->transport->is_success ? $_[1]
: $_[0]->transport->status;
},
};
bless $self => $class;
$self->on_nonserialized( $self->on_nonserialized
|| $self->serializer->on_nonserialized );
SOAP::Trace::objects('()');
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/Connpass/Event/Participant.pm view on Meta::CPAN
use strict;
use warnings;
sub new {
my $class = shift;
bless {@_} => $class;
}
sub answer {
my ($self, $index) = @_;
return $self->{"answer_$index"};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/Deezer.pm view on Meta::CPAN
debug => 0,
};
$self->{ua}->agent("WWW::Deezer v".$VERSION);
bless $self => $class;
return $self;
}
sub album {
my ($self, $p) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/Mechanize/PhantomJS.pm view on Meta::CPAN
if ( $@ ) {
kill 9, delete $options{ pid } if $options{ kill_pid };
die $@;
}
my $self= bless \%options => $class;
$self->eval_in_phantomjs(<<'JS');
var page= this;
page.errors= [];
page.alerts= [];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/Moviepilot.pm view on Meta::CPAN
=cut
sub new {
my ($class, $args) = @_;
my $self = bless {} => $class;
$self->{api_key} = $args->{api_key} || croak "api_key is missing at " . __PACKAGE__ . "->new()";
$self->{host} = $args->{host} || 'www.moviepilot.de';
$self->{ua} = $args->{ua} || LWP::UserAgent->new;
$self->{host} = 'http://' . $self->{host} unless $self->{host} =~ m{^http://};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/PGXN.pm view on Meta::CPAN
our $VERSION = v0.13.0;
sub new {
my($class, %params) = @_;
my $self = bless {} => $class;
for my $key (qw(url proxy)) {
$self->$key($params{$key}) if exists $params{$key}
}
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/StreamSend.pm view on Meta::CPAN
xs => XML::Simple->new,
};
$self->{ua}->agent("Mozilla/5.0");
bless $self => $class;
return $self;
}
sub get_emails {
my ($self) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WebService/Bluga/Webthumb.pm view on Meta::CPAN
if (exists $params{cache_dir} && ! exists $params{cache_url_stub}) {
croak "Must supply cache_url_stub if you supply cache_dir";
}
my $self = \%params;
bless $self => $class;
$self->{ua} = LWP::UserAgent->new(
agent => __PACKAGE__ . '/' . $VERSION,
timeout => $params{timeout} || 3,
);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Mock/Guard.pm view on Meta::CPAN
++$stash->{$class_name}->{$method_name}->{called_count};
&$mocked_method;
}, $prototype);
}
}
return bless { restore => $restore, object => $object } => $class;
}
sub call_count {
my ($self, $klass, $method_name) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WebSocket/Version.pm view on Meta::CPAN
my $req = shift( @_ ) || return( $self->error( "No WebSocket::Request object was provided." ) );
return( $self->error( "Object provided (", overload::StrVal( $req ), ") is not a WebSocket::Request object." ) ) if( !$self->_is_a( $req, 'WebSocket::Request' ) );
my $h = $req->headers || return( $self->error( "Unable to find the WebSocket::Headers object." ) );
unless( ref( $self ) )
{
$self = bless( {} => $class )->SUPER::init( @_ );
}
my $new;
# From version 4 onward
if( $h->header( 'Sec-WebSocket-Version' )->length ||
$h->header( 'Sec-WebSocket-Key' )->length )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Weewar.pm view on Meta::CPAN
{ package Weewar::UA;
use base 'LWP::UserAgent';
sub new {
my ($class, $args) = @_;
$args ||= {};
bless $args => $class;
}
sub get_basic_credentials {
my $self = shift;
return unless $self->{username};
return (map {$self->{$_}} qw/username password/);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Win32/Wlan.pm view on Meta::CPAN
}
$args{interface} = $interfaces[0];
}
}
}
bless \%args => $class;
};
sub DESTROY {
my ($self) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Workflow/Factory.pm view on Meta::CPAN
my ($class) = @_;
unless ( $INSTANCES{$class} ) {
$log->debug( "Creating empty instance of '$class' factory for ",
"singleton use" );
my $instance = bless {} => $class;
$instance->init();
$INSTANCES{$class} = $instance;
}
return $INSTANCES{$class};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XML/DOMBacked.pm view on Meta::CPAN
}
sub new {
my $class = shift;
my $self = {};
bless $self => $class;
my $init = eval { $self->init( @_ ) };
if (!$init) {
my $mesg = "could not initialise object";
if ( $@ ) { $mesg .= ': ' . $@ }
die $mesg;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XML/DT/Sequence.pm view on Meta::CPAN
=cut
sub new {
my ($class) = @_;
return bless { } => $class;
}
sub break {
my $self = shift;
$self->{BREAK} = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XML/Parser/LiteCopy.pm view on Meta::CPAN
sub new {
my $class = shift;
return $class if ref $class;
my $self = bless {} => $class;
my %parameters = @_;
$self->setHandlers(); # clear first
$self->setHandlers(%{$parameters{Handlers} || {}});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XML/Parser/Lite.pm view on Meta::CPAN
sub new {
my $class = shift;
return $class if ref $class;
my $self = bless {} => $class;
my %parameters = @_;
$self->setHandlers(); # clear first
$self->setHandlers(%{$parameters{Handlers} || {}});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XML/Smart/HTMLParser.pm view on Meta::CPAN
sub new {
my $this = shift ;
my $class = ref($this) || $this ;
return $this if ref $this ;
$this = bless {} => $class ;
_unset_sig_warn() ;
my %args = @_ ;
_reset_sig_warn() ;
$this->setHandlers(%args) ;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XMLRPC/Test.pm view on Meta::CPAN
package My::PingPong; # we'll use this package in our tests
sub new {
my $self = shift;
my $class = ref($self) || $self;
bless {_num=>shift} => $class;
}
sub next {
my $self = shift;
$self->{_num}++;
view all matches for this distribution