Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Why does this code think I'm trying to use symbolic references?

by AnomalousMonk (Archbishop)
on Jun 12, 2016 at 22:58 UTC ( [id://1165442]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why does this code think I'm trying to use symbolic references?
in thread Why does this code think I'm trying to use symbolic references?

... I'm normally quite prodigious with my horizontal whitespace ...

Either prodigality or parsimony seem to work; e.g.,  print $n+4; also avoids the problem. Apparently it's only  $n +4 that Perl looks at and says "Oh, of course: a unary plus!" (I haven't tested it, but I assume the same would happen | I've tested it, and the same thing happens with a pseudo-unary minus.)

Update: Per perlop, unary + and - have higher precedence than the binary operators.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1165442]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-24 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found