in reply to while loop logic
Simpler to have a scalar which indicates which state you're in instead.
my $in_comment = undef; while( <CMDTXTF> ) { my @fld = split /\|/, $_; do { $in_comment = 1; next } if $fld[5] =~ m{ /\* }x; do { $in_comment = undef; next } if $fld[5] =~ m{ \*/ }x; print "$fld[0] $fld[2] sequence=$fld[4] $fld[5]" if /$regex/ and not $in_comment; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: while loop logic
by Roy Johnson (Monsignor) on Jan 13, 2006 at 15:35 UTC | |
by Anonymous Monk on Jan 16, 2006 at 09:47 UTC | |
by BrowserUk (Patriarch) on Jan 16, 2006 at 10:29 UTC | |
by Anonymous Monk on Jan 16, 2006 at 12:57 UTC | |
by BrowserUk (Patriarch) on Jan 16, 2006 at 19:23 UTC |