Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
All the files have been sorted, therefore, looping through file.1 file.2 etc. However, if the 'if' statement is run i need to exit the for loop and go to the next while loop entry. e.g. if the 'if' loop is executed on file.2 go to next while step and try again with file.1 I am not sure how to exit the for loop? Thankswhile (<FH>) { ($col1, $col2) = split m/\s+/; for $file (keys %files) { if (exists $files{$file}{$col2} ) { .....do something.... } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: exit a loop
by grep (Monsignor) on Nov 09, 2006 at 16:21 UTC | |
by Anonymous Monk on Nov 09, 2006 at 16:37 UTC | |
|
Re: exit a loop
by davorg (Chancellor) on Nov 09, 2006 at 16:18 UTC | |
|
Re: exit a loop
by Melly (Chaplain) on Nov 09, 2006 at 16:19 UTC |