On Monday, December 9, 2002, at 08:14  AM, Adam D. Lopresto wrote:
Looks to me like with a few appropriate methods, you have left-to-right
ordering for free.

(@foo, @bar) := @a
    . grep { $_ > 0}
    . sort { $^b <=> $^b }
    . part [/foo/, /bar/];
Hmm. Does operator precedence allow that?

@a . grep { $_ > 0 } . sort { $^b <=> $^b };

Or does it think the second dot is attempting to call a method of the thing returned by the closure { $_ > 0 }, not the result of (@a.grep { $_ > 0 })?

E.G. if 'grep' is a normal method, wouldn't the dot operator bind more tightly to the closure { $_ > 0 } than the method name 'grep' would?

MikeL

Reply via email to