Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: shift implicit dereference

by LanX (Bishop)
on Oct 06, 2013 at 13:39 UTC ( #1057148=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
      DB<122> $a
     => 5
      DB<125> $a
     => 7
  2. or download this
      DB<126> sub ref_add { ${ shift() }+=2 }
      DB<131> $a
     => 11
  3. or download this
      DB<102> $a=11
     => 11
      DB<104> ref_add3 \$a; $a
     => 13
  4. or download this
           Any arguments passed in show up in the array @_.  Therefore, if
    + you
           called a function with two arguments, those would be stored in 
           for the actual scalar parameters.  In particular, if an element
    + $_[0]
           is updated, the corresponding argument is updated (or an error 
           if it is not updatable). 

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057148]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2018-03-17 10:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (223 votes). Check out past polls.