Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: Pre vs Post Incrementing variables

by JavaFan (Canon)
on Sep 13, 2010 at 08:55 UTC ( [id://859955]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Pre vs Post Incrementing variables
in thread Pre vs Post Incrementing variables

The fact that f( ++$n, ++$n ) passes an alias to $n, rather than the value resulting from the preincrement, is just another broken behaviour.
Note that this behaviour isn't unique to ++.
sub f {say "@_"} my $n = 1; f $n += 2, $n += 2; __END__ 5 5

Replies are listed 'Best First'.
Re^5: Pre vs Post Incrementing variables
by ikegami (Patriarch) on Sep 13, 2010 at 16:33 UTC
    grep, values and lvalue subs also return lvalues. substr, pos and keys can also return lvalues.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found