view release on metacpan or search on metacpan
lib/Acme/CreatingCPANModules.pm view on Meta::CPAN
follows:
sub new {
my $self = shift;
my $foo = shift;
bless \$foo, $self;
}
sub set {
my $self = shift;
my $newfoo = shift;
lib/Acme/CreatingCPANModules.pm view on Meta::CPAN
=cut
sub new {
my $self = shift;
my $foo = shift;
bless \$foo, $self;
}
=head2 set
Sets the new value of the object.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Curse.pm view on Meta::CPAN
package Acme::Curse;
=head1 NAME
Acme::Curse - Remove the blessing that lay on references
=head1 SYNOPSIS
use Acme::Curse qw(curse);
my $unblessed_ref = curse($object);
=head1 DESCRIPTION
Did you ever want to droo the blessing of an object? Well, now you can:
Acme::Curse unblesses reference by returning a shallow, non-blessed copy
of the object.
Currently only references to scalar, hashes, arrays and code objects can
be unblessed.
Exported subs:
=over 4
=item curse
Unblesses a reference to an object.
=back
=head1 BUGS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Curses/Marquee/Extensions.pm view on Meta::CPAN
#Set up the display
$args{winy} ||= int($args{winh}/2 - $args{height}/2);
$args{win} = new Curses($args{height},$args{winw},$args{winy},$args{winx});
my $self = bless \%args, $class;
$self->text($self->{srctxt}) if (defined $self->{srctxt});
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Curses/Marquee.pm view on Meta::CPAN
die "Can't create marquee object without height value\n"
unless( defined $args{height} );
die "Can't create marquee object without width value\n"
unless( defined $args{width} );
my $self = bless { win => $args{window},
height => $args{height},
width => $args{width},
font => $args{font} || 'standard',
srctxt => $args{text} || undef,
figtxt => '',
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
# make a dahut
#-------------------------------------------------------------------#
sub new {
my $class = ref($_[0]) ? ref(shift) : shift;
my $dahut = \substr($class, 6, 5);
return bless $dahut, $class;
}
#-------------------------------------------------------------------#
#-------------------------------------------------------------------#
# call a dahut
Acme::Dahut is the produce of the deranged imaginations of the #axkit
Higher Circles.
As far as I know, it's the only module the constructor of which returns
a blessed LVALUE. But this is to be expected, as it powerfully captures
the business logic of a Left Dahut.
=head1 METHODS
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Daily/Fail.pm view on Meta::CPAN
"britain's fishermen",
"the countryside",
"british justice",
"british sovereignty",
"common sense and decency",
"the queen", # God bless 'er
"the king", # God bless 'im
"the royal family",
"the church",
"you",
"your mortgage",
"your pension",
view all matches for this distribution
view release on metacpan or search on metacpan
use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK );
$VERSION = '0.08';
@ISA = qw( Exporter DynaLoader );
@EXPORT = qw( damn );
@EXPORT_OK = qw( bless );
# ensure we aren't exposed to changes in inherited AUTOLOAD behaviour
*Acme::Damn::AUTOLOAD = *DynaLoader::AUTOLOAD;
__END__
=pod
=head1 NAME
Acme::Damn - 'Unbless' Perl objects.
=head1 SYNOPSIS
use Acme::Damn;
my $ref = ... some reference ...
my $obj = bless $ref , 'Some::Class';
... do something with your object ...
$ref = damn $obj; # recover the original reference (unblessed)
... neither $ref nor $obj are Some::Class objects ...
=head1 DESCRIPTION
B<Acme::Damn> provides a single routine, B<damn()>, which takes a blessed
reference (a Perl object), and I<unblesses> it, to return the original
reference.
=head2 EXPORT
=over 4
=item B<damn> I<object>
B<damn()> accepts a single blessed reference as its argument, and returns
that reference unblessed. If I<object> is not a blessed reference, then
B<damn()> will C<die> with an error.
=item B<bless> I<reference>
=item B<bless> I<reference> [ , I<package> ]
=item B<bless> I<reference> [ , undef ]
Optionally, B<Acme::Damn> will modify the behaviour of C<bless> to
allow the passing of an explicit C<undef> as the target package to invoke
B<damn()>:
use Acme::Damn qw( bless );
my $obj = ... some blessed reference ...;
# the following statements are equivalent
my $ref = bless $obj , undef;
my $ref = damn $obj;
B<NOTE:> The modification of C<bless> is lexically scoped to the current
package, and is I<not> global.
=back
Not everyone likes to damn the same way or in the same language, so
B<Acme::Damn> offers the ability to specify any alias on import, provided
that alias is a valid Perl subroutine name (i.e. all characters match C<\w>).
use Acme::Damn qw( unbless );
use Acme::Damn qw( foo );
use Acme::Damn qw( unblessthyself );
use Acme::Damn qw( recant );
Version 0.02 supported a defined list of aliases, and this has been replaced
in v0.03 by the ability to import any alias for C<damn()>.
=head1 WARNING
Just as C<bless> doesn't call an object's initialisation code, C<damn> doesn't
invoke an object's C<DESTROY> method. For objects that need to be C<DESTROY>ed,
either don't C<damn> them, or call C<DESTROY> before judgement is passed.
=head1 ACKNOWLEDGEMENTS
Thanks to Claes Jacobsson E<lt>claes@surfar.nuE<gt> for suggesting the use of
aliases, and Bo Lindbergh E<lt>blgl@cpan.orgE<gt> for the suggested
modification of C<bless>.
=head1 SEE ALSO
L<bless|perlfunc/bless>, L<perlboot>, L<perltoot>, L<perltooc>, L<perlbot>,
L<perlobj>.
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/DarmstadtPM/TieHash.pm view on Meta::CPAN
sub TIEHASH {
my ($class,$code) = @_;
my $self = {};
bless $self,$class;
$self->{HASH} = {};
$self->{CODE} = $code;
return $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Data/Dumper/Extensions.pm view on Meta::CPAN
my $DD_Defaults;
BEGIN {
no warnings 'once';
$DD_Defaults = {
Bless => q[bless],
Deepcopy => 0,
Deparse => 0,
Freezer => q[],
Indent => 2,
Maxdepth => 0,
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/Debug.pm view on Meta::CPAN
sub new {
my $proto = shift;
my $class = ref($proto) ? ref($proto) : $proto;
my $self = {};
bless($self, $class);
foreach my $f (@_) {
next unless -f $f;
my $l = 0;
if (open(FH, "< $f")) {
map { DB::DB($f, $l, $_), $l++ } (<FH>);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/DependOnEverything.pm view on Meta::CPAN
use Acme::CPANModules::PortedFrom::NPM;
use Acme::CPANModules::PortedFrom::Python::targ;
use Acme::CPANModules::PortedFrom::Ruby;
use Acme::CPANModules::StructuredDATA;
use Acme::CPANModules::TextTable;
use Acme::CPANModules::Unbless;
use Acme::CPANModules::UpsideDownTextWithUnicode;
use Acme::CPANModulesUtil::FeatureMatrix::targ;
use Acme::CPANModules::WorkingWithTree;
use Acme::CPANModules::XSVersions;
use Acme::CPANPLUS::Module::With::Failing::Configure::Requ;
lib/Acme/DependOnEverything.pm view on Meta::CPAN
use Class::PublicPrivate;
use Class::Publisher;
use Class::Random;
use Class::RDF;
use Class::Rebirth;
use Class::Rebless;
use Class::Ref;
use Class::Refresh;
use Class::ReturnValue;
use Class::Role;
use Class::Roles;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Dot.pm view on Meta::CPAN
=head1 SYNOPSIS
package Foo;
use Acme::Dot;
sub new { bless {}, shift }
sub hello { print "Hi there! (@_)\n" }
package main;
my $x = new Foo;
$x.hello(1,2,3); # Calls the method
view all matches for this distribution
view release on metacpan or search on metacpan
examples/dump.pl view on Meta::CPAN
my $data = {
foo => "bar\nber",
ber => {
beer => [qw/x y z/],
obj => bless([], 'Foo::Bar'),
},
};
print DnD $data;
view all matches for this distribution
view release on metacpan or search on metacpan
"$_: $$i{$_}", map substr("m;V",0,length) ^ $_, sort map
$_ ^ substr("m;V",0,length), keys %$i ) . "." ) :
eval{1+@$_}?(!@$_?(): join( "; ", @$_ ) ) : $_
} @_;
my( $thought )= !@_ ? undef : join " ... ", @_;
return bless \$thought, 'Acme::ESP::Scanner';
}
sub O'o { [ shift,oO( @_ ) ]->[!$[] }
package Acme::ESP::Scanner;
unpack $fmt, unpack "P32", pack "L", $p2;
$pv= $p3
if $fmt =~ /^x/;
$secret= unpack "P$iv", pack "L", $pv-$iv;
}
bless $scanner, 'Acme::ESP';
my $thought= $$scanner;
if( defined $thought ) {
# It is surprising how hard it can be to clear your mind.
# It'd be nice to do this less destructively.
my $surface= "$$mind";
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
# to STDOUT, making my job harder.
$SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /is not a known parameter/};
*STDWHATEVER = *STDOUT; *STDOUT = *foo; tie *STDOUT, 'gronk';
{package #
gronk;
sub TIEHANDLE { bless[] }
sub PRINT {
shift;
return if $_[0] =~ /is not a known MakeMaker parameter/;
print ::STDWHATEVER @_;
}
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/ExceptionEater.pm view on Meta::CPAN
use vars qw( $VERSION );
use version; $VERSION = qv('0.0.1');
# Module implementation here
sub new { bless {}, shift }
sub DESTROY { eval {} }
1; # Magic true value required at end of module
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/EyeDrops.pm view on Meta::CPAN
$must, not $despair;
$I->can(do{ $it });
study new Idea;
m/mmmm/m... do{able};
kill $chickens;
'ask', $Nanabozo, 2, bless $me, 'with more inspiration';
$so, close; warn $mailing_list and alarm $Andrew;
$toil until my $solution < /-\ndrew's
/;
GOT_IT:
send $solution, $to, ref;
lib/Acme/EyeDrops.pm view on Meta::CPAN
; # ;
#;#;#;#;#
On 15 August 2003, Perl/Parrot Euro-hacker and modern artist
Leon Brocard (pictured above) marched into a secluded
aranciate-blessed, orange-walled room at MoMA and tossed
a black Victoria's Secret bra (pictured below) into
the air, thereby creating a brilliant contemporary
site-specific art exhibit.
''=~('(?' .'{'.('['
view all matches for this distribution
view release on metacpan or search on metacpan
Shamelesly stolen from B<DMA::FSM>.
Originally, it meant some opaque HASH passed around in B<DMA::FSM::FSM()>
where
user-code could store it's own ideas and such.
Now it's an object blessed into B<Acme::FSM>
(for user-code still, I<{fsm}> has nothing to do with it).
=item entry
Layout of state records (see below) isn't particularly complicated.
ref $opts eq q|HASH| or croak sprintf
q|[connect]: {options} HASH is required, got (%s) instead|, ref $opts;
my( $trailer, $leader );
if( ref $self eq '' ) {
$trailer = ref $_[0] eq q|HASH|;
$self = bless { _ => { fst => $trailer ? shift @_ : { @_ }}}, $self;
$leader = q|clean init with| }
else {
$trailer = @_;
$self = bless { _ => { %{$self->{_}} }}, ref $self;
$leader = q|stealing| }
$self->{_}{$_} = delete $opts->{$_} // $self->{_}{$_} foreach @options;
$self->{_}{diag_level} //= 1;
$self->diag( 3, q|%s (%i) items in FST|,
$leader, scalar keys %{$self->{_}{fst}} );
Separate class:
package Secret::Class;
sub new { bless { }, shift }
sub bravo_sc {
shift;
shift % 42, ''
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Filter/Kenny.pm view on Meta::CPAN
my ($ref) = [];
if (grep {/^:iq_kenny$/} @params) {
$iq_kenny = 1;
}
filter_add (bless $ref);
}
sub filter {
my $self = (@_);
my ($status);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/FishFarm/Feeder.pm view on Meta::CPAN
$options{current_food_amount} = $options{food_tank_capacity};
}
$options{first_usage} = 1; # make sure the feeder doesn't say timer is up as soon as it is switched on
bless \%options, $class;
}
=head1 TIMER RELATED SUBROUTINES/METHODS
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} =~ 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/Free/API/Geodata/GeoIP.pm view on Meta::CPAN
use JSON::XS qw(decode_json);
sub new($proto, %config) {
my $class = ref($proto) || $proto;
my $self = bless \%config, $class;
my $agent = WWW::Mechanize->new(cookie_jar => {});
$agent->agent('PerlMonks contest/1 (https://perlmonks.org/?node_id=11161472)');
$agent->stack_depth(1);
$self->{agent} = $agent;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/Advice/Slip.pm view on Meta::CPAN
$res->{success} ? decode_json( $res->{content} ) : ();
}
#
sub advice ( $slip_id //= () ) {
my $res = _http( 'https://api.adviceslip.com/advice' . ( $slip_id ? '/' . $slip_id : '' ) );
defined $res->{slip} ? bless $res->{slip}, __PACKAGE__ : ();
}
sub search ($query) {
my $res = _http( 'https://api.adviceslip.com/advice/search/' . $query );
map { bless $_, __PACKAGE__ } @{ $res->{slips} // [] };
}
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/Advice/Unsolicited.pm view on Meta::CPAN
$res->{success} ? decode_json( $res->{content} ) : ();
}
#
sub advice ( $advice_id //= () ) {
my $res = _http( 'https://kk-advice.koyeb.app/api/advice' . ( $advice_id ? '/' . $advice_id : '' ) );
defined $res->{error} ? () : bless $res, __PACKAGE__;
}
sub all () {
my $res = _http('https://kk-advice.koyeb.app/api/advice/all');
map { bless $_, __PACKAGE__ } @{ $res // [] };
}
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Ghost.pm view on Meta::CPAN
$group = getpwuid($gid || 0) unless length $group;
# Check name
croak "Can't create unnamed daemon\n" unless $name;
my $self = bless {
name => $name,
user => $user,
group => $group,
uid => $uid,
gid => $gid,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Github/Test.pm view on Meta::CPAN
sub new {
my $class = shift;
my @options = @_;
my $self = { @options };
return bless $self, $class
}
sub freep {
my $self = shift;
view all matches for this distribution