Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: sub routine help

by ikegami (Patriarch)
on Jul 31, 2009 at 04:31 UTC ( #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? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2022-05-22 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (81 votes). Check out past polls.

    Notices?