kentfredric/Dist-Zilla-Plugin-AutoVersion-Relative — pull request #2 by karenetheridge (2012-02-02 21:18:12+00:00)
Title: add prototypes to all anonymous subs...

... passed into Text::Template, to avoid inadvertent gobbling of arithmetic terms in the expression

This will help avoid situations like that described on #distzilla:

12:49 * ether tries to figure out why Text::Template interprets {{ foo + 1 }}
differently than {{ 1 + foo }}, where foo is a sub
12:50 < ether> foo + 1 evaluates to foo, bizarrely
12:50 < ether> foo() + 1 evaluates properly
12:50 < rjbs> what about "use strict; foo + 1" ?
12:51 < ether> no change, no helpful diagnostics
12:51 < rwstauner> what about foo(+1)
12:52 < ether> that would pass 1 as an arg, which foo() ignores
12:52 < rjbs> Text::Template is mostly just perl, so have you tested without it
in th eway?
12:54 < ether> as in something like eval "sub foo { 1 }; foo + 1" ?
12:54 < rjbs> or something.
12:55 < ether> indeed that exhibits the same behaviour. wtf.
12:56 < ether> this feels like an issue with (the lack of) prototypes
12:56 < ether> perl -wle'sub foo { 10 }; print foo + 1' -> 10
13:04 < doy> ether: perl -MO=Deparse,-p -E'...'
13:04 < doy> is quite useful for debugging precedence issues