Graham Barr wrote: >> Peter Scott wrote: >>> This very nearly qualifies as an easter egg. Inspect the following: >>> perl -e 'close STDIN; open STDIN, "<", \$x; print <>' > > Yes. <> is reading from stdin in C (file descriptor 2) which will be > what was first opened after closing STDIN. > The open STDIN, "<", \$x causes the PerlIO module to be loaded, so the > first file opened is PerlIO.pm > What you see in the output is what is after the __END__ in PerlIO.pm I would have been more impressed if it WAS an easter egg... Hahaha... Thanks for the explanation, Graham. Cheers, mark P.S. This sort of issue has bit me before. On some systems, init runs /etc/inittab entries without an STDIN, STDOUT, or STDERR. This leads to many issues as these file descriptors are inevitable assigned some important, and if the script assumes STDIN, STDOUT, or STDERR do exist, and do something with them, or close them... -- Mark Mielke <mark@mielke.cc>Thread Previous | Thread Next