I'm pretty sure unary plus existed very early in Perl (it makes perfect sense for it to have been included in the first version of the expression grammar). Not only did early unary + not numerify, I verified that in Perl 4 unary + didn't even impose scalar context.
Now, unary minus actually did numerify in Perl 4. It was early in Perl 5 when unary minus was taught to just prepend '-' when applied to a string. And I think there was a slight delay between that and -(-bar) being taught to yeild '+bar'. There was also some early finagling to make -bar => ... not complain about 'bareword' even under 'use strict;'.
- tye
In reply to Re^2: About the + in front of a hashref that disambiguates from a code block. (unary -)
by tye
in thread About the + in front of a hashref that disambiguates from a code block.
by PoorLuzer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |