Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Basically after getting the input which starts with 2, i want to handle the remaining lines in a different manner, so going to a different loop. But this break, is not breaking the first while loop ? I understand, it is my misunderstanding, but what is it, and how to solve it ?while (<STDIN>) { print "--> $_"; if ( /^2/ ) { break; } print "--> $_"; } while (<STDIN>) { print "==> $_"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: whats wrong with this break ?
by kennethk (Abbot) on Sep 17, 2010 at 13:37 UTC | |
by TomDLux (Vicar) on Sep 17, 2010 at 16:54 UTC | |
|
Re: whats wrong with this break ?
by wfsp (Abbot) on Sep 17, 2010 at 13:34 UTC | |
by Anonymous Monk on Sep 17, 2010 at 13:47 UTC | |
by MajingaZ (Beadle) on Sep 17, 2010 at 14:41 UTC | |
by GrandFather (Saint) on Sep 17, 2010 at 22:21 UTC | |
|
Re: whats wrong with this break ?
by TomDLux (Vicar) on Sep 17, 2010 at 17:22 UTC |