in reply to Does perl 5.8.2 have a bug with 'redo' statement

I think the following is equivalent to your code:

while( my $line = <FH> ) { while (1) { chomp( $line ); last if $line !~ /^#/; } print "Doesn't begin with #\n"; }

Replies are listed 'Best First'.
Re^2: Does perl 5.8.2 have a bug with 'redo' statement
by ikegami (Patriarch) on May 21, 2010 at 05:30 UTC
    Or if the extra scope is a problem,
    while( my $line = <FH> ) { REDO: chomp( $line ); if( $line =~ /^#/ ) { goto REDO; } print "Doesn't begin with #\n"; }

      Everyone-- thanks for the insights.