Acme-Damn
view release on metacpan or search on metacpan
and next;
# otherwise, create an alias for 'damn'
no strict 'refs';
*{ $pkg . '::' . $alias } = sub {
my $ref = shift;
my ( undef , $file , $line ) = caller 1;
# call damn() with the location of where this method was
# originally called
&{ __PACKAGE__ . '::damn' }( $ref , $alias , $file , $line );
# NB: wanted to do something like
# goto \&{ __PACKAGE__ . '::damn' };
# having set the @_ array appropriately, but this caused a
# "Attempt to free unrefernced SV" error that I couldn't solve
# - I think it was to do with the @_ array
};
}
=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
By default, B<Acme::Damn> exports the method B<damn()> into the current
namespace. Aliases for B<damn()> (see below) may be imported upon request.
=head2 Methods
Acme::Damn - 'Unbless' Perl objects.
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 ...
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
Acme::Damn uses XS to access the internals of Perl for it's magic, and
therefore must be compiled to be installed. Also, for testing,
Acme::Damn relies on Test::More and Test::Exception.
DESCRIPTION
Acme::Damn provides a single routine, damn(), which takes a blessed
reference (a Perl object), and *unblesses* it, to return the original
reference.
EXPORT
By default, Acme::Damn exports the method damn() into the current
namespace. Aliases for damn() (see below) may be imported upon request.
Methods
damn *object*
damn() accepts a single blessed reference as its argument, and
returns that reference unblessed. If *object* is not a blessed
( run in 0.356 second using v1.01-cache-2.11-cpan-1c8d708658b )