in reply to Passing a $Scaler into a while loop...
It may be that what you want is:
while (defined (my $line = <WORDS>)) {
which avoids issues with values for $line that evaluate to false in a boolean context.
If that is not your problem then a better example would include some data like this:
use strict; use warnings; while (<DATA>) { chomp; my @words = split /\s+/; while (@words) { $_ = shift @words; next if ! defined $_; next unless /a/ && /e/ && /i/ && /o/ && /u/; print "Matched: $_\n"; } } __DATA__ aeiou 0 nothing here aeiou again
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing a $Scaler into a while loop...
by chromatic (Archbishop) on Oct 09, 2006 at 05:17 UTC | |
|
Re^2: Passing a $Scaler into a while loop...
by chinamox (Scribe) on Oct 09, 2006 at 04:31 UTC |