Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: is $i=+3 valid?

by Rahul6990 (Beadle)
on Jul 05, 2013 at 07:09 UTC ( [id://1042622]=note: print w/replies, xml ) Need Help??


in reply to is $i=+3 valid?

The correct way to use it is :

$i+=3;

+= is called the short hand operator, similar to this you can use:

-= , *= , /=

Replies are listed 'Best First'.
Re^2: is $i=+3 valid?
by AnomalousMonk (Archbishop) on Jul 06, 2013 at 01:21 UTC
    += is called the short hand operator...

    I've never before seen or heard it so called. This is not important, just idle curiosity, but can you cite an example of this usage?

    Update: Actually, Googling just now found a number of examples of this usage. Never mind...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-23 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found