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>
In reply to Re: Help Explain Behavior
by BrowserUk
in thread Help Explain Behavior
by Joe_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |