On Wed, Apr 09, 2003 at 09:01:25PM -0400, Joseph F. Ryan wrote: > And then you could do: > > use Colorific qw(Blue Cloud); > > my Colorific @skysamples = peek_with_some_hardware; > my $clear_day = @skysamples ~~ /<Blue>* <Cloud>/; > > Which ain't too bad, in my book. (-: That is pretty nifty, but how would you say something like "match 2 blue things, then a thing that isa Bird, then something that can fly"? Your way puts all of the logic in the pattern method when it's probably better in the rule itself, especially if the stream of objects we're matching against is heterogeneous: @things ~~ /<.color(Blue)><2><.isa(Bird)><.can(fly)>/; versus @things ~~ /<Blue><2><Bird><fly>/; Imagine that @things contains 2 X objects and 2 Y objects that would cause the match to succeed. The pattern method for the Y object would have to somehow handle both the .isa and .can ideas. How would it know which to apply when? -Scott -- Jonathan Scott Duff duff@cbi.tamucc.eduThread Previous | Thread Next