view release on metacpan or search on metacpan
lib/Acme/Speed.pm view on Meta::CPAN
ShimabukuroHiroko
);
sub new {
my $class = shift;
my $self = bless {members => []}, $class;
$self->_initialize;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Spinner.pm view on Meta::CPAN
$self->{y} = shift;
$self->{x} = shift;
$self->{count} = 0;
$self->{seq} = '|\\-/';
return bless( $self, $class );
}
=head2 next
Bump the spinner by one and return it.
view all matches for this distribution
view release on metacpan or search on metacpan
package Number {
sub new {
my ($class, $n) = @_;
bless \$n, $class;
}
sub add {
my ($self, $n) = @_;
Number->new($$self + $$n);
view all matches for this distribution
view release on metacpan or search on metacpan
Stegano/Stegano.pm view on Meta::CPAN
{
my ($class,$filename) = @_;
my @file;
tie @file, 'Tie::File', $filename
or croak "Cant tie filename $filename: $!";
bless \@file, $class
}
sub insert
{
my ($self,$text) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
sub new {
my $class = shift;
croak "Use a classname, not a reference for " . __PACKAGE__ . "::new"
if ref $class;
my $self = bless {}, $class;
my %args = @_;
my $acceptable = $self->_keys();
foreach (keys %args) {
croak "Unknown parameter $_" unless exists $acceptable->{$_};
$self->set($_, $args{$_});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/String/Trim.pm view on Meta::CPAN
sub new {
my $class = shift;
$class = ref $class if ref $class;
return bless { _string => shift, }, $class;
}
sub string {
my ( $self, $string ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/object_use_example.pl view on Meta::CPAN
#
sub new {
my $proto = shift;
my $package = __PACKAGE__;
my $class = ref($proto) || $proto || $package;
my $self = bless {}, $class;
BindParms : (
my $thing : thing [optional, default="Something Blue"];
my $other : other_thing [required, is_defined];
)
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Syntax/Python.pm view on Meta::CPAN
_block_depth => 0,
_lambda_block => {},
_class_block => {},
_debug => $params{debug}
);
filter_add(bless \%context, $class);
}
sub error {
my ($self) = shift;
my ($message) = shift;
lib/Acme/Syntax/Python.pm view on Meta::CPAN
$self->{_lambda_block}->{$self->{_block_depth}} = 0;
s/^/$spaces\};\n/;
} elsif ($self->{_class_block}->{$self->{_block_depth}}){
my $spaces_front = _handle_spacing($self->{_block_depth}, 0);
$self->{_class_block}->{$self->{_block_depth}} = 0;
s/^/$spaces_front return bless \$self, \$class;\n$spaces\}\n/;
} else {
s/^/$spaces\}\n/;
}
-- $self->{_block_depth};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Taboo.pm view on Meta::CPAN
our $VERSION = "0.01";
our @CENSORED = ('xxx', '***', '???', '(CENSORED)');
sub new {
my ($class, @list) = @_;
bless [@list], $class;
}
sub censor {
my ($self, $str) = @_;
my $taboo = my $replace = undef;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Teddy.pm view on Meta::CPAN
# : @init : All remaining args
# Returns : $self
# Invokes : init()
#
# If invoked with $class only,
# blesses an empty hashref and calls init() with no args.
#
# If invoked with $class and a reference,
# blesses the reference and calls init() with any remaining args.
#
sub new {
my $class = shift;
my $self = shift || {}; # default: hashref
bless ($self => $class);
$self->init(@_);
return $self;
}; ## new
lib/Acme/Teddy.pm view on Meta::CPAN
my $bear = Acme::Teddy->new( \&my_sub );
my $bear = Acme::Teddy->new( { -a => 'x' } );
my $bear = Acme::Teddy->new( [ 1, 2, 3, 4 ] );
my $bear = Acme::Teddy->new( {}, @some_data );
It will bless any reference. If invoked with C<$class> only,
blesses an empty hashref and calls L</init()> with no arguments.
If invoked with C<$class> and a reference,
blesses the reference and calls L</init()> with any remaining C<@args>.
=head2 init()
This is a placeholder method. You might want to override it in a subclass.
For common initializations, you can just invoke L</new()> with initial data.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Terror/NL.pm view on Meta::CPAN
};
sub new {
my ($class, %args) = @_;
my $self = {};
bless $self, $class;
$self->{_level} = UNKNOWN;
$self->{_level_txt} = "UNKNOWN";
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Terror/UK.pm view on Meta::CPAN
sub new {
my ($class, %args) = @_;
$class = ref($class) if (ref $class);
return bless(\%args, $class);
}
sub fetch {
my $self = shift;
my $url = 'http://www.mi5.gov.uk/';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Terror.pm view on Meta::CPAN
sub new {
my ($class, %args) = @_;
$class = ref($class) if (ref $class);
return bless(\%args, $class);
}
sub fetch {
my $url = "http://www.dhs.gov/dhspublic/getAdvisoryCondition";
my $con = get($url);
view all matches for this distribution
view release on metacpan or search on metacpan
sub new {
my ($proto,$conf) = @_;
my $class = ref($proto) || $proto;
my $self = {};
bless($self,$class);
croak "File not supplied" unless defined $conf->{'filename'};
croak "Could not read $conf->{filename}" unless -r $conf->{'filename'};
$self->{'filename'} = $conf->{'filename'};
view all matches for this distribution
view release on metacpan or search on metacpan
sv_2uv_flags||5.009001|
sv_2uv|5.004000||p
sv_add_arena|||
sv_add_backref|||
sv_backoff|||n
sv_bless|||
sv_buf_to_ro|||
sv_buf_to_rw|||
sv_cat_decode||5.008001|
sv_catpv_flags||5.013006|
sv_catpv_mg|5.004050||p
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Text/Viceversa.pm view on Meta::CPAN
our $VERSION = "0.07";
sub new {
my $class = shift;
return bless {}, $class;
}
my %ascii = (
q' ' => ' ', # same!
q'!' => '¡',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/TextLayout.pm view on Meta::CPAN
sub new {
my $class = shift;
my %opts = @_;
my $self = \%opts;
bless $self, $class;
$.Class = $class;
return $self;
}
=head2 B<instantiate>
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/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 () };
t/lib/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/Acme/Tie/Eleet.pm view on Meta::CPAN
my $self = &_new; # magic call.
$self->{FH} = $fh;
# Return it.
return bless( $self, $pkg );
}
sub TIESCALAR {
# Process args.
lib/Acme/Tie/Eleet.pm view on Meta::CPAN
my $self = &_new; # magic call.
$self->{value} = undef;
# Return it.
return bless( $self, $pkg );
}
#--
# Handlers.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Tie/Formatted.pm view on Meta::CPAN
sub TIEHASH {
my $class = shift;
# Someplace to hang our hat.
bless \my($self), $class;
}
sub FETCH {
my ($self, $key) = @_;
return '' unless $key;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Timecube.pm view on Meta::CPAN
}
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
$self->{ua} = LWP::UserAgent->new;
$self->{wisdom} = HTML::TreeBuilder->new_from_content( $self->{ua}->get( 'http://www.timecube.com' )->decoded_content );
$self->{wisdom} or die "Couldn't fetch wisdom...\n";
@{ $self->{verses} } = $self->{wisdom}->find_by_tag_name( 'p' );
return $self
view all matches for this distribution
view release on metacpan or search on metacpan
}
$Changed_lastval{$key}=$now;
return $e?1:undef;
}
#todo: sub unbless eller sub damn
#todo: ..se også: use Data::Structure::Util qw/unbless/;
#todo: ...og: Acme::Damn sin damn()
#todo? sub swap($$) http://www.idg.no/computerworld/article242008.ece
#todo? catal
#todo?
#void quicksort(int t, int u) int i, m; if (t >= u) return; swap(t, randint(t, u)); m = t; for (i = t + 1; i <= u; i++) if (x[i] < x[t]) swap(++m, i); swap(t, m) quicksort(t, m-1); quicksort(m+1, u);
1;
package Acme::Tools::BloomFilter;
use 5.008; use strict; use warnings; use Carp;
sub new { my($class,@p)=@_; my $self=Acme::Tools::bfinit(@p); bless $self, $class }
sub add { &Acme::Tools::bfadd }
sub addbf { &Acme::Tools::bfaddbf }
sub check { &Acme::Tools::bfcheck }
sub grep { &Acme::Tools::bfgrep }
sub grepnot { &Acme::Tools::bfgrepnot }
view all matches for this distribution
view release on metacpan or search on metacpan
$self->{'steps'} ||= 250;
my $tapelen = 200;
$self->{'tape'} = [ (" ") x $tapelen ];
$self->{'tape_pos'} = int($tapelen / 2);
return bless($self, $class);
}
# Add an entry to the spec hash.
sub add_spec {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
{
package foo;
sub quux {}
}
my $i = bless {}, 'foo';
lives_ok {
ok $i->cannot('bar');
};
ok !$i->can('bar');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/UNIVERSAL/new.pm view on Meta::CPAN
sub UNIVERSAL::new
{
my $class = get_class();
my $ref = get_ref();
bless $ref, $class;
}
sub get_class
{
my ($root, $prefix) = @_;
lib/Acme/UNIVERSAL/new.pm view on Meta::CPAN
beneath the given C<$symbol_table> reference named C<$name_prefix>. If you
pass neither argument, this starts in the main symbol table.
=head2 C<get_ref()>
Returns a random blessable reference.
=head2 C<has_constructor( $class_name )>
Returns true if the given class has a constructor named C<new()> that is I<not>
C<UNIVERSAL::new()>.
view all matches for this distribution