Acme-Undead
view release on metacpan or search on metacpan
Revision history for Perl extension Acme-Undead
0.03 2017-07-18T05:48:39Z
- fixed Changes messages.
0.02 2017-07-18T05:37:59Z
- support one-argument `bless`
- add requires `Test::Exception` on test.
0.01 2017-07-04T10:32:43Z
- original version
print 'Hell world';
#Hell world
no Acme::Undead;
die() #died;
# DESCRIPTION
Acme::Undead is export routines, die(), bless() and sleep().
Use Acme::Undead when dont die at die(), die at bless() and not sleep at sleep().
# OVERRIDE METHODS
## die
undead is not die!
## sleep
undead is not sleeping
## bless
the god bless clean undead auras.
# LICENSE
Copyright (C) likkradyus.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
# AUTHOR
lib/Acme/Undead.pm view on Meta::CPAN
print 'Hell world';
#Hell world
no Acme::Undead;
die() #died;
=head1 DESCRIPTION
Acme::Undead is export routines, die(), bless() and sleep().
Use Acme::Undead when dont die at die(), die at bless() and not sleep at sleep().
=head1 OVERRIDE METHODS
=head2 die
undead is not die!
=head2 sleep
undead is not sleeping
=head2 bless
the god bless clean undead auras.
=cut
our @EXPORT = qw/die sleep bless/;
our $IS_UNDEAD = 0;
sub import {
my $class = shift;
my $caller = shift;
$^H{acme_undead} = 1;
$IS_UNDEAD = 1;
{
no strict 'refs';
no warnings;
lib/Acme/Undead.pm view on Meta::CPAN
my $class = shift;
my $hinthash = (caller(0))[10];
return $hinthash->{acme_undead} ? undef : die(shift);
}
sub _sleep {
my $hinthash = (caller(0))[10];
return $hinthash->{acme_undead} ? undef : sleep(shift);
}
sub _bless {
my $hinthash = (caller(0))[10];
return $hinthash->{acme_undead} ? die('blessed') : do {
my $arg = shift;
my $pkg = shift || (caller(0))[0];
bless($arg, $pkg);
}
}
sub END {
return unless $IS_UNDEAD;
my @signals = keys %SIG;
my $pid = fork();
if ($pid){
local %SIG;
for my $sig (@signals){
( run in 0.812 second using v1.01-cache-2.11-cpan-de7293f3b23 )