On Thu Dec 08 03:25:08 2011, evdokimov.denis@gmail.com wrote: > #!/usr/bin/perl > use strict; > use warnings; > > my $data = "aaa\nbbb\nccc\n"; > > # Ok > close STDIN or die $!; > open( STDIN, '<', \$data ) or die $!; > @ARGV = (); > while (<STDIN>) > { > print "[[$ARGV]]***$_"; > } > > # Bug > close STDIN or die $!; > open( STDIN, '<', \$data ) or die $!; > @ARGV = (); > while (<>) > { > # print PerlIO.pod > print "[[$ARGV]]***$_"; > } By closing STDIN you are closing fd 0, which is reused by the next file opened. I seem to remember this came up about three years ago and the consensus was that it is not a bug. I’m not sure. If my memory serves me correctly, searching for ‘you passed sub protections’ and ‘This gotta change’ in the archives will bring it up. -- Father ChrysostomosThread Previous | Thread Next