case in point:
package H; sub DESTROY { print "DESTROY\n"; } sub new { my $class = shift; bless {}, $class; } { if(my $h = H->new()) { print "IN\n"; undef $h; } print "\$h out of scope\n"; } print "why now?\n";
produces:
IN DESTROY $h out of scope why now?
As does:
package H; sub DESTROY { print "DESTROY\n"; } sub new { my $class = shift; bless {}, $class; } { { if(my $h = H->new()) { print "IN\n"; } } print "\$h out of scope\n"; } print "why now?\n";
In reply to Re^4: if(my) scope
by ig
in thread if(my) scope
by oha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |