Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Perl oddities

by Anonymous Monk
on Mar 01, 2005 at 16:11 UTC ( #435501=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl oddities
in thread Perl oddities

You aren't subtracting from a left squiggly when you put a minus in front of it either. It's not that + in this expression is special cased. Unary + in Perl is a noop. (Just like unary plus is a noop when doing arithmetic). In the example you give, putting a plus there is just one of the ways to do disambiguations. Putting parenthesis after shift works as well, as well as something else that's essentially a noop (adding an empty string for instance).

I wouldn't call an idiom a Perl oddity - it's not part of the language itself, just an often used construct.


Comment on Re^2: Perl oddities

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (20)
As of 2015-07-06 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (80 votes), past polls