"Hanson, Robert" <[EMAIL PROTECTED]> writes:

> One way is to do this...
> 
> while ( my $line = <FILE> ) {
>       next if ( /^\s*$/ );
> }

NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! NO!

Your loop sets $line (but not $_),
but your RE checks $_ (but not $line).

There are two solutions to your bug...

# use $line
while ( my $line = <FILE> ) {
        next if ( $line =~ /^\s*$/ );
}

# use $_
while ( <FILE> ) {
        next if ( /^\s*$/ );
}


-- 
Michael R. Wolf
    All mammals learn by playing!
        [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to