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

1mies should start the match, so
mies mies
should be printed in that case (updated the OP, to clarify)
  • Comment on Re^2: .. operator and not including the condition of right operand
  • Download Code

Replies are listed 'Best First'.
Re^3: .. operator and not including the condition of right operand
by dragonchild (Archbishop) on Apr 27, 2005 at 19:05 UTC
    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.

      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 ]