Skip to content

Instantly share code, notes, and snippets.

@yappo
Created August 15, 2011 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yappo/1145662 to your computer and use it in GitHub Desktop.
Save yappo/1145662 to your computer and use it in GitHub Desktop.
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