On Tue, 2004-09-21 at 02:52 -0600, Luke Palmer wrote: > If you replace the first line: > > method Rule::Group::generate(Int $n) { > > With > > multi generate (Rule::Group $group: Int $n) { > > Everything ought still to work. > > I think the best you can do is to implement it as a routine. You can't > really make it a modifier, because it's pretty separate from actually > matching anything.
Minor nitpick, you can do away with the integer parameter - to me it makes more sense to just lazily spew an infinite list of generated matches. Then you'd do @results = generate(/a*/) [0..999]; to get 1000 results, but you can also do @results = generate(/a*/); while !$hell.frozen() { shift @results; } Miro