http://qs1969.pair.com?node_id=1146041

stevieb has asked for the wisdom of the Perl Monks concerning the following question:

Looking at making some changes to a module that loops over an array (actually a list, handed off from a file handle, where I'd like to loop on the handle itself).

Internally, do for() and while() do the same thing, ie., are the following equivalent?:

for (<$fh>){ print; } while (<$fh>){ print; }

With that simple example, they seem to do the same thing (in v5.22 on Linux Mint at least). But below the surface, do they really?

-stevieb