go ahead... be a heretic | |
PerlMonks |
Re: close ARGV inside a whileby liverpole (Monsignor) |
on Jun 08, 2006 at 13:17 UTC ( [id://554271]=note: print w/replies, xml ) | Need Help?? |
Hello again, jesuashok,
I'm not sure why you think it's strange behaviour; it seems logical to me. You are putting $0 (the name of the current file) into @ARGV, and then reading from that file. When you close the file with close ARGV, you've already read one line, which is in $_. So when you do:
you are simply printing out a period '.', concatenated with the first line of the Perl script itself. Try taking out the line close ARGV; and the whole program will be printed:
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|