Acme-Voodoo
view release on metacpan or search on metacpan
lib/Acme/Voodoo.pm view on Meta::CPAN
## if we're dead, then we're gonna die
croak( "arrrghgghg, an evil curse has struck me down!\n" )
if $deads{ ref($doll) };
## if we are a zombie, go to sleep for a random amount of time
## and then wake up remembering nothing
if ( $zombies{ ref($doll) } ) {
print STDERR "I feel as if I'm walking into a strange dream\n";
sleep( $dreamTime || int( rand(100) ) * 10 );
$zombies{ ref($doll) } = undef;
}
## strip namespace off of method
my ($method) = ( $AUTOLOAD =~ /.*::(.*)$/ );
## our real object
my $object = $dolls{ ref($doll) };
my $class = ref( $object );
no strict;
return( undef ) if $method eq 'DESTROY';
## call the method on the real object, with the right args
## note: we will return the return value of our method call
&{ "${class}::${method}" }( $object, @args );
}
## no more voodoo
1;
( run in 1.361 second using v1.01-cache-2.11-cpan-d80b1682f3f )