in reply to Re: using multiple conditionals in a while(test)
in thread using multiple conditionals in a while(test)
gets translated into while( defined( local $_ = COND ) ) {.
Not quite. The $_ variable is NOT localized in a while loop:
$ echo "one two three four five six seven eight nine ten" | perl -e' while ( <> ) { last if /seven/; } print "$.: $_\n"; ' 7: seven
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: using multiple conditionals in a while(test)
by BrowserUk (Patriarch) on Dec 04, 2010 at 07:51 UTC | |
by How09 (Novice) on Dec 04, 2010 at 14:25 UTC |