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

Re: sub routine help

by ikegami (Patriarch)
on Jul 31, 2009 at 04:31 UTC ( [id://784807]=note: print w/replies, xml ) Need Help??


in reply to sub routine help

Prototypes alter parsing rules, alter the context in which arguments are evaluated, and limit what operators appear as arguments. Since those are all compile-time effects, prototypes have no run-time effects.

This means that $subref->() doesn't care if the referenced sub has a prototype or not.

sub foo(\@) { ...} foo(@a); # Passes \@a my $subref = \&foo; $subref->(@a); # Passes $a[0]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found