Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Forcing list context of passed parameters

by papidave (Monk)
on Sep 28, 2007 at 22:25 UTC ( #641626=note: print w/ replies, xml ) Need Help??


in reply to Re: Forcing list context of passed parameters
in thread Forcing list context of passed parameters

Sidhekin and others wrote:

just give up this use of prototypes
This would seem to be the consensus. Having suffered through years of mismatched parameters in C, and having been rescued by good parameter checking when the ANSI standard finally came out for the platforms where I was working, a habit was formed that didn't map well into this environment.

I had a good chat with mr_mischief regarding http://perldoc.perl.org/perlsub.html#Prototypes and in particular the section referencing retrofits that explains the root cause on my list getting eaten.

Having been soundly downvoted (ouch!), I guess I will be forced to follow more closely to the docs:

This is all very powerful, of course, and should be used only in moderation to make the world a better place.
and leave my lack of moderation to other vices.


Comment on Re^2: Forcing list context of passed parameters
Re^3: Forcing list context of passed parameters
by Fletch (Chancellor) on Sep 28, 2007 at 22:38 UTC

    Prototypes in perl aren't parameter checking, they're hints to the compiler that you're trying to mimic the calling convention of a builtin. If you still want parameter checking look into something like Params::Validate.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-12-25 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (160 votes), past polls