On Mon, Dec 27, 2010 at 10:03 PM, Chas. Owens > { } by itself creates a
lambda (i.e. an anonymous function), so it may

> > be that you are returning an anonymous function that never gets
> > executed.  Try using parentheses instead of braces.
>
> Or better yet, don't use anything.  Since ++ has higher precedence
> than ??!!, it doesn't need to any parentheses:
>
> $r1 > $r2 ?? %matches{$p1}++ !! %matches{$p2}++ ;
>


Ah. That makes sense. I hadn't realized that squiggly brackets were lambdas.
Very cool. To prove that they are lambdas, I confirmed that the following
works:

$r1 > $r2 ?? {%matches{$p1}++}() !! {%matches{$p2}++}();

So, in this needlessly complex code, I basically create an anonymous
function and immediately execute it.

Cheers,
Daniel.
-- 
No trees were destroyed in the generation of this email, but a large number
of electrons were severely inconvenienced.

Reply via email to