Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Using & in function calls (&foo != foo(@_))

by lodin (Hermit)
on Sep 29, 2007 at 16:08 UTC ( [id://641702]=note: print w/replies, xml ) Need Help??


in reply to Re: Using & in function calls
in thread Using & in function calls

It passes the current @_ to the function called.

This is probably just a matter of wording, but I'd say it's sharing @_. &foo and foo(@_) are not equivalent. An example:

sub foo1 { &bar; print "@_\n"; } sub foo2 { bar(@_); print "@_\n"; } sub bar { shift } foo1(1, 2, 3); foo2(1, 2, 3); __END__ 2 3 1 2 3

lodin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2025-07-10 14:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.