However:
print $fh while <>;
is both shorter and clearer.
Update: Argh! that falls foul of the OP's complaint. It needs to be:
print $fh $_ while <>;
to work as intended.
In reply to Re^2: Where automatic variable $_ doesn't work?
by GrandFather
in thread Where automatic variable $_ doesn't work?
by guiwp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |