in reply to Operator precedence of unary plus (Bug or Feature)

There is no unary plus operator. The "+" is part of the number literal, as defined in perldata.

(If it was a unary plus operator, the behaviour would require a two token lookahead, and that's very unlikely.)

  • Comment on Re: Operator precedence of unary plus (Bug or Feature)

Replies are listed 'Best First'.
Re^2: Operator precedence of unary plus (Bug or Feature)
by ikegami (Patriarch) on Feb 05, 2012 at 00:04 UTC

    And now, I shall prove myself at least partially wrong:

    >perl -wE"my $x=4; my $y=5; say $x + 6" 10 >perl -wE"my $x=4; my $y=5; say $x +6" say() on unopened filehandle 4 at -e line 1. >perl -wE"my $x=4; my $y=5; say $x +$y" say() on unopened filehandle 4 at -e line 1.