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; }
In reply to Re: while loop logic
by Fletch
in thread while loop logic
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |