Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: sub argument passing? (TIMTOWTDI)

by temporal (Pilgrim)
on Sep 17, 2012 at 14:58 UTC ( [id://994047]=note: print w/replies, xml ) Need Help??


in reply to Re: sub argument passing? (TIMTOWTDI)
in thread sub argument passing? (TIMTOWTDI)

Cool, didn't know that Perl supported function prototyping. Looks a bit quicker and dirtier than using Params::Check - fewer filtering options, no default values, etc.

I am gravitating towards creating a separate file which would contain all of my function prototypes and then I would require that in my module. My module has quite a few functions so this might be the easiest way to keep track of them all and have a single point of change rather than having to track down all that template-building legwork within the subroutines themselves that Params::Check requires.

Not quite as legible, though. And to heed the docs warning, I could get into trouble writing prototypes for already written functions. So I'll have to do a little checking to make sure I'm not doing anything too silly with how arguments are being passed and unpacked.

Anyway, thanks for pointing this out protist =)

Strange things are afoot at the Circle-K.

Replies are listed 'Best First'.
Re^3: sub argument passing? (TIMTOWTDI)
by choroba (Cardinal) on Sep 17, 2012 at 15:02 UTC
      This should provide some enjoyable light reading. :P Thank you choroba.
Re^3: sub argument passing? (TIMTOWTDI)
by AnomalousMonk (Archbishop) on Sep 17, 2012 at 21:10 UTC
    Cool, didn't know that Perl supported function prototyping.

    It doesn't. It's more like 'function argument context prototyping'. Please read the highly recommended Far More Than...

Re^3: sub argument passing? (TIMTOWTDI)
by protist (Monk) on Sep 17, 2012 at 16:11 UTC
    You are welcome. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found