view release on metacpan or search on metacpan
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
identifier => $identifier,
description => $spec->{description},
prereqs => CPAN::Meta::Prereqs->new($spec->{prereqs}),
);
bless \%guts => $class;
}
#pod =method identifier
#pod
#pod This method returns the feature's identifier.
view all matches for this distribution
view release on metacpan or search on metacpan
identifier => $identifier,
description => $spec->{description},
prereqs => CPAN::Meta::Prereqs->new($spec->{prereqs}),
);
bless \%guts => $class;
}
sub identifier { $_[0]{identifier} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/plmetrics.pm view on Meta::CPAN
qr/^files?$/i => sub { $_[0]->_view_files($_[1]) },
);
sub new {
my ($class, $opt) = @_;
bless +{ opt => $opt } => $class;
}
sub opt { $_[0]->{opt} }
sub run {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Arango/DB/Collection.pm view on Meta::CPAN
use warnings;
use strict;
sub _new {
my ($class, %opts) = @_;
return bless {%opts} => $class;
}
sub create_document {
my ($self, $body) = @_;
die "Arango::DB | Refusing to store undefined body" unless defined($body);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Arango/Tango/Collection.pm view on Meta::CPAN
sub _new {
my ($class, %opts) = @_;
return bless {%opts} => $class;
}
sub bulk_import {
my ($self, $documents, %options) = @_;
$options{type} ||= "list";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Dir.pm view on Meta::CPAN
sub new {
my ($class, $directory) = @_;
my $self = {
directory => dir($directory),
};
bless $self => $class;
$self
};
sub directory {
$_[0]->{directory}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Rar/Passthrough.pm view on Meta::CPAN
stderr => '',
( ref($proto) ? %$proto : () ),
};
$self->{rar} = $args{rar} if exists $args{rar};
bless $self => $class;
return() if not $self->{rar} = $self->_findbin();
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/SevenZip.pm view on Meta::CPAN
for( keys %class_defaults ) {
$options{ $_ } = $class_defaults{ $_ }
unless defined $options{ $_ };
};
bless \%options => $class
}
sub version {
my( $self_or_class, %options) = @_;
for( keys %class_defaults ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Array/AsHash.pm view on Meta::CPAN
return $class->_initialize(@_);
}
sub _initialize {
my ( $class, $arg_ref ) = @_;
my $self = bless {} => $class;
$self->{array_for} = [];
return $self unless $arg_ref;
my $array = $arg_ref->{array} || [];
$self->{is_strict} = $arg_ref->{strict};
$array = Clone::clone($array) if $arg_ref->{clone};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Array/Heap/ModifiablePriorityQueue.pm view on Meta::CPAN
=cut
sub new {
my ($class) = @_;
return bless { heap => [], items => {} } => $class;
}
=item $pq->add($item, $weight)
Add an item to the priority queue with the given weight. If the item is
view all matches for this distribution
view release on metacpan or search on metacpan
bin/asterisk-lcr-myroutes view on Meta::CPAN
sub new
{
my $class = shift;
my $self = bless { @_ } => $class;
my $file = $self->{file};
open FP, "<$file" or die "Cannot read open $file";
$self->{lines} = [ map { chomp(); $_ } <FP> ];
close FP;
view all matches for this distribution
view release on metacpan or search on metacpan
package MyOverload;
sub new {
my ($class, $value) = @_;
bless \$value => $class;
}
sub add : Overload(+) {
my ($self, $value) = @_;
$$self += 2 * $value;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Auth/GoogleAuthenticator.pm view on Meta::CPAN
if( $args{ secret_base32 }) {
$args{ secret } = decode_base32( delete $args{ secret_base32 });
};
$args{ auth } ||= Authen::OATH->new();
bless \%args => $class;
}
sub auth { $_[0]->{auth} };
sub registration_qr_code {
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/TestTie.pm view on Meta::CPAN
@ISA = qw(Tie::Scalar);
sub TIESCALAR {
my $class = shift;
my $instance = @_ ? shift : undef;
return bless \$instance => $class;
}
sub FETCH {
return ${$_[0]};
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/TestTie.pm view on Meta::CPAN
@ISA = qw(Tie::Scalar);
sub TIESCALAR {
my $class = shift;
my $instance = @_ ? shift : undef;
return bless \$instance => $class;
}
sub FETCH {
return ${$_[0]};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Backblaze/B2.pm view on Meta::CPAN
} else {
$options{ bucket_class } ||= 'Backblaze::B2::v1::Bucket::Synchronized';
$options{ file_class } ||= 'Backblaze::B2::v1::File::Synchronized';
};
bless \%options => $class
}
sub read_credentials {
my( $self, @args ) = @_;
$self->api->read_credentials(@args)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Maxd.pm view on Meta::CPAN
}
if (!$ok) {
print STDERR "WARNING: Run 'extendMaxD' to configure database\n";
$data{'dbh'} = undef;
}
$self = bless {} => $class;
foreach $tag (keys %data) { $self->{$tag} = $data{$tag}; }
return $self;
}
sub export {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BioX/Seq/Stream.pm view on Meta::CPAN
sub new {
my ($class,$fn, %args) = @_;
my $self = bless {} => $class;
# 'fast' mode turns off parser sanity-checking in places
if ($args{fast}) {
$self->fast( $args{fast} );
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-parse-config.t view on Meta::CPAN
# returns them when asked for
package MockStore;
use strict;
sub new {
my ($class, $settings) = @_;
return bless { settings => $settings } => $class;
}
sub get {
my ($self, $namespace, $key) = @_;
return unless $namespace eq 'GitHub';
return $self->{settings}{$key};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Store.pm view on Meta::CPAN
sub new {
my $class = shift;
my $self;
my $logger = Log::Log4perl->get_logger($class);
if ( @_ % 2 == 0 ) {
$self = bless {@_} => $class;
}
elsif ( @_ == 1 and ref $_[0] eq 'HASH' ) {
$self = $class->new_from_hashref( $_[0] );
}
elsif ( @_ == 1 and !ref $_[0] ) {
$self = $class->new_from_hashref( { type => $_[0] } );
}
elsif ( !@_ ) {
$self = bless {} => $class;
}
else {
$logger->warn(
"Argument to new() is neither an argument list, a hashref, a string nor empty"
);
view all matches for this distribution
view release on metacpan or search on metacpan
eg/lib/Foo.pm view on Meta::CPAN
use Boundary::Impl qw(IFoo);
sub hello { ... }
sub world { ... }
sub new { my $class = shift; bless {} => $class }
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bread/Board/Service/Deferred.pm view on Meta::CPAN
sub new {
my ($class, %params) = @_;
(Scalar::Util::blessed($params{service}) && $params{service}->does('Bread::Board::Service'))
|| Carp::confess "You can only defer Bread::Board::Service instances";
bless { service => $params{service} } => $class;
}
sub meta {
if ($_[0]->{service}->can('class')) {
my $class = $_[0]->{service}->class;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brownie/Session.pm view on Meta::CPAN
$self->{server} = $server;
$self->{app_host} = 'http://localhost:' . $server->port;
}
}
return bless $self => $class;
}
sub DESTROY {
my $self = shift;
delete $self->{driver} if exists $self->{driver};
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/lib/ModPerl/CScan.pm view on Meta::CPAN
"$Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $filename |" :
"echo '\#include \"$filename\"' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
#my $cmd = "echo '\#include <$filename>' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
(open($sym, $cmd) or die "Cannot open pipe from `$cmd': $!")
and bless $sym => $class;
}
sub text {
my $class = shift;
my $filter = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
my $cmd = "echo '\#include \"$filename\"' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
#my $cmd = "$Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} < $filename |";
#my $cmd = "echo '\#include <$filename>' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
(open($sym, $cmd) or die "Cannot open pipe from `$cmd': $!")
and bless $sym => $class;
}
sub text {
my $class = shift;
my $filter = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Structured/Tools/Starter.pm view on Meta::CPAN
my $self = $class->SUPER::new(@opts);
$self->{templates} = { $self->templates };
$self->{renderer} = $self->renderer;
return bless $self => $class;
}
=head2 create_distro ( %args )
This method works as advertised in L<Module::Starter>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Builder/Auth/GroupAdmin/SQL.pm view on Meta::CPAN
GROUPFIELD => "group", #field for the group
);
sub new {
my($class) = shift;
my $self = bless { %Default, @_ } => $class;
$self->_check(qw(DRIVER DB GROUPTABLE));
if(!defined $self->{'DBH'}) { $self->db($self->{DB}) }
else { $self->{'_DBH'} = $self->{'DBH'}; };
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Form/Table.pm view on Meta::CPAN
return unless $arg{columns};
return unless $arg{prefix};
$arg{initial_rows} = 1 unless $arg{initial_rows};
$arg{initial_rows} = @{$arg{initial_values}}
if ($arg{initial_values} && @{$arg{initial_values}} > $arg{initial_rows});
bless \%arg => $class;
}
=head2 C<< $form->as_html >>
This returns HTML representing the form object. JavaScript is required to make
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Header.pm view on Meta::CPAN
our $VERSION = '0.63';
sub new {
my $class = shift;
my %args = @_ == 1 ? %{$_[0]} : @_;
( bless \%args => $class )->_rehash;
}
sub header {
$_[0]->{header} ||= {};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/JSONRPC/Session.pm view on Meta::CPAN
1;
sub new {
my ($class,%args) = @_;
%args = __PACKAGE__->init_session(%args);
return bless { dispatcher => $class->default_dispatcher, %args }, $class;
}
sub _generate_sid {
my ($class,$r) = @_;
# ok this makes me feel dirty but it's either use the id generate from
view all matches for this distribution