Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen

by Crackers2 (Parson)
on Oct 01, 2010 at 23:33 UTC ( #863023=note: print w/replies, xml ) Need Help??


in reply to Re: Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen
in thread Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen

the situation of declaring a proto with sub foobar($); and then calling it with foo(@a) and expecting that to throw an error rather than evaluating the array in scalar context.

I'd argue that the more common expectation is that this should just use the first element of @a, which is what would happen if there was no prototype.

Which is what I've seen often quoted as the biggest problem with perl prototypes; instead of enforcing subroutine arguments, it changes the way arguments are parsed.

  • Comment on Re^2: Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863023]
help
Chatterbox?
[Corion]: marto: Currently all well - work is even OK currently ;) I should start translating my WWW::Mechanize:: Chrome talk to English and recheck that my demos all work, but I have two weeks for that still :)
[Corion]: So, most things are looking good :-D
[Corion]: I should write some more code for my Jekyll clone, but I don't feel like it, so maybe I should just let that linger instead ;)
[karlgoethebier]: "...mein enemy..."
[marto]: it has finally stopped raining!
[Corion]: marto: Heh - we've got the rain here, now. But it's only intermittently, not permanent. But funny that you should complain about rain ;)
[Discipulus]: rain? i dont remember it..
[marto]: and good news all round, Flash will die come 2020!

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-07-26 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (390 votes). Check out past polls.