Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: perlsub prototype sub(_) sub foo(_)

by farang (Chaplain)
on Jun 30, 2013 at 13:30 UTC ( #1041589=note: print w/ replies, xml ) Need Help??


in reply to Re: perlsub prototype sub(_) sub foo(_)
in thread perlsub prototype sub(_) sub foo(_)

If you are referring to my node, there's probably nothing wrong with the documentation, just my quick reading of it. When it says you can use _ in place of $ I got the idea that prototypes (_) and ($) would be the same, which is not the case.

sub foo(_){ warn @_ } sub goo($){ warn @_ } foo(); goo();
output:
Not enough arguments for main::goo at pm3 line 4, near "()"
Execution of pm3 aborted due to compilation errors.


Comment on Re^2: perlsub prototype sub(_) sub foo(_)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-28 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls