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