Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 wandering the Monastery: (3)
As of 2024-04-25 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found