in reply to Re: Package scope SPOILER
in thread Package scope

Comment on spoiler text inside:
What you are seeing is STDIN, STDOUT and STDERR being destroyed.

I assumed that when I saw three handles destroyed that it was the STD* trio, but it's not true, you don't see STDOUT's destruction. The third (actually the second (for ActivePerl v5.8.4 built for MSWin32-x86-multi-thread)) handle to be destroyed is ARGV.

I came up with this play on the original idea:

use 5.008;sub UNIVERSAL::DESTROY{($_=$_[ 0])=~s/=.*//;print}bless*STDIN{IO},"ha". "cker,\n";$i=bless[],"Just ";bless*ARGV{ IO},"Perl ";bless*STDERR{IO},"another ";

This works on the v5.8.4 above, but not on v5.6.1 built for i386-linux (Debian). (With the use 5.008; removed.)