NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
nice and clear (Score:1)
I have to say that I've seen the other examples of this and I think this is definitely the cleanest and easiest to understand. Using $^a, $^b and $^c with the arity checks definitely beats all those pops, shifts, etc.
but just one thing more (Score:1)
I agree, though I think it might need a special-case for zero-arity so that could could write an arbitrary reduction:
'sum' => { @stack = [+] @stack }, ...
hmm, can that be written as assignment-operator?
'sum' => { @stack [+]= () },
Re: (Score:1)
Perhaps
or something along those lines would work.