Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Package scope SPOILER

by Ven'Tatsu (Deacon)
on Oct 06, 2004 at 13:50 UTC ( [id://396985]=note: print w/replies, xml ) Need Help??


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.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://396985]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found