Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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?
[marto]: this sounds like a sub section for Sane Dots
[Corion]: marto: You mean "Sane Dots Dramatic Reading of ITIL" ? ;)
[marto]: Sane Dots, chapter 13: ITIL never work :P
[marto]: sorry, bad pun of it'll :P
[Corion]: :-D
[Corion]: I think that ITIL is mostly to prevent people from doing harm to a system that basically runs unattended :)
[Corion]: Maybe you could reduce ITIL to a computer network, a man and a dog. The network runs the computations. The man is there to feed the dog. The dog is there to prevent the man from accessing the computers.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2017-01-24 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (203 votes). Check out past polls.