in reply to Re^3: Here there be camels!
in thread Here there be cammels!
Using DATA was just an example, the same thing happens on a normal filehandle too.
system 'echo "foo" >/tmp/blah'; open my $fh, '<', '/tmp/blah' or die $!; while (<$fh>) { chomp; warn "<$_>"; } warn "One"; $. = 123; warn "Two"; close $fh; warn "Three"; $. = 456; warn "Four"; __END__ <foo> at - line 3, <$fh> line 1. One at - line 4, <$fh> line 1. Two at - line 6, <$fh> line 123. Three at - line 8. Four at - line 10, <$fh> line 456.
So LanX is probably right about it being more of a bug than an obscure feature :-)
|
|---|