Your code, shown below, does not work the same way.
This is a common myth. I (pretty recently) used to believe the same thing. Deparse shows us the light, though:
$ perl -MO=Deparse -e 'while ($var = <fh>) {}' while (defined($var = <fh>)) { (); }
In reply to Re^2: How to extract Start .. End from multiline file
by revdiablo
in thread How to extract Start .. End from multiline file
by gasho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |