$exitloop = false; while(<FH> || $exitloop){ if($line eq "__END__"){ $exitloop = true; } # Do other stuff here... }
On Friday, June 13, 2003, at 01:16 PM, Nicholas G. Thornton wrote:
I have a program I'm working on that reads a text file and does stuff with it.
Thing is I want to exit from the while(<FH>) loop prematurely if, say, the line
is '__END__'. I can't figure out how to do this, exit and return don't work, any
ideas?
~wren