Instantly share code, notes, and snippets.

Embed
What would you like to do?
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