http://www.perlmonks.org?node_id=758656

vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:

I got this question from this site

question

They would have given some answers, but I did not get the clarification, thats why I posted this question here to get more clarification I am sorry that I not informed the site where I got this question pardon me! please

I have a filehandle FILE in Perl, and I want to iterate over all the lines in the file. Is there a difference between the following?

while (<FILE>) { # do something } and foreach (<FILE>) { # do something }
Vinoth,G