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


in reply to Using loops inside an 'if' statement

Hi jonnyfolk,

There is nothing wrong with putting a while in an if statement. The problem you have is a syntax error. Change

while (<FILE)> { to while (<FILE>) {

Notice the order of the brackets

Hope this helps

thinker