>perl -e "use strict; if (my $x = foo()) { } print $x; Global symbol "$x" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. #### sub P1::DESTROY { print 'd'; } sub P2::DESTROY { print 'c'; } { print('a'); if (my $x = bless({}, 'P1')) { my $y = bless({}, 'P2'); print('b'); } print('e'); } print("\n");