in reply to Re^2: .. operator and not including the condition of right operand
in thread .. operator and not including the condition of right operand

my $good; for (@aap) { my ($type, $value) = /^(\d)(.*)/ or next; if ( $type == 0 ) { $good = 0; next; } elsif ($type == 1) { $good = 1; } next unless $good; print "$value\n"; }
(Untested)

The Perfect is the Enemy of the Good.

  • Comment on Re^3: .. operator and not including the condition of right operand
  • Download Code

Replies are listed 'Best First'.
Re^4: .. operator and not including the condition of right operand
by halley (Prior) on Apr 27, 2005 at 19:46 UTC
    Though I don't doubt this sort of code works, I think he said 'more elegant', not just a working solution. He was finding fault with the use of two separate captures in the two conditions of the flipflop (..) range operator.

    --
    [ e d @ h a l l e y . c c ]