Damian Conway wrote:
> 
> Michael Lazzaro wrote:
> 
> > How would you do something like:
> >
> >     (@foo,@bar,@zap) := classify { /foo/ ;; /bar/ ;; /zap/ } @source;
> 
> Since I don't understand what that's supposed to do, I probably *wouldn't*
> do something like it. What effect are you trying to achieve?

Sorry.  A shorthand for:

  for @source {
      given {
          when /foo/ { push @foo, $_ }
          when /bar/ { push @bar, $_ }
          when /zap/ { push @zap, $_ }
      }
  }

.... that "classifies" (or "parts") @source according to the results of a
series of tests, not just one.

MikeL

Reply via email to