Created
August 15, 2011 03:28
-
-
Save yappo/1145662 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use common::sense; | |
package Hoge; | |
sub BEGIN { | |
BEGIN {${^WARNING_BITS} = "<?3\000\017\360\017\300\360\3743\000\000"} | |
BEGIN { | |
$^H{'feature_say'} = q(1); | |
$^H{'feature_state'} = q(1); | |
$^H{'feature_switch'} = q(1); | |
} | |
require Devel::GlobalDestruction; | |
do { | |
'Devel::GlobalDestruction'->import | |
}; | |
} | |
sub new { | |
BEGIN {${^WARNING_BITS} = "<?3\000\017\360\017\300\360\3743\000\000"} | |
BEGIN { | |
$^H{'feature_say'} = q(1); | |
$^H{'feature_state'} = q(1); | |
$^H{'feature_switch'} = q(1); | |
} | |
my($class, $str) = @_; | |
bless \$str, $class; | |
} | |
sub DESTROY { | |
BEGIN {${^WARNING_BITS} = "<?3\000\017\360\017\300\360\3743\000\000"} | |
BEGIN { | |
$^H{'feature_say'} = q(1); | |
$^H{'feature_state'} = q(1); | |
$^H{'feature_switch'} = q(1); | |
} | |
say '-----------------------: ' . ${$_[0];}; | |
say 'in_global_destruction(): ' . in_global_destruction; | |
say '${^GLOBAL_PHASE} : ' . ${^GLOBAL_PHASE}; | |
} | |
package main; | |
BEGIN {${^WARNING_BITS} = "<?3\000\017\360\017\300\360\3743\000\000"} | |
BEGIN { | |
$^H{'feature_say'} = q(1); | |
$^H{'feature_state'} = q(1); | |
$^H{'feature_switch'} = q(1); | |
} | |
{;}; | |
sub BEGIN { | |
my $hoge = 'Hoge'->new('BEGIN'); | |
} | |
sub CHECK { | |
my $hoge = 'Hoge'->new('CHECK'); | |
} | |
sub INIT { | |
my $hoge = 'Hoge'->new('INIT'); | |
} | |
sub END { | |
my $hoge = 'Hoge'->new('END'); | |
} | |
do { | |
my $hoge = 'Hoge'->new('do') | |
}; | |
my $hoge = 'Hoge'->new('normal'); | |
my $hash = {'hoge', 'Hoge'->new('cycle')}; | |
$$hash{'hash'} = $hash; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment