in reply to Help Explain Behavior
Its a little more surprising than that even. Not only is the script still in memory and still running after you unlink it.
It is still on the disk also ... until the script exits ... at which point it automagically vanishes:
C:\test>copy con surprise.pl #! perl -slw use strict; unlink $0; print "still here"; print for glob $0; print "Still there also"; ^Z 1 file(s) copied. C:\test>surprise.pl still here C:\test\surprise.pl Still there also C:\test>dir surprise.pl Directory of C:\test File Not Found C:\test>
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Help Explain Behavior
by Joe_ (Beadle) on Aug 19, 2012 at 17:22 UTC | |
by BrowserUk (Patriarch) on Aug 19, 2012 at 18:00 UTC | |
by Joe_ (Beadle) on Aug 19, 2012 at 19:32 UTC |
In Section
Seekers of Perl Wisdom