CGI.pm note

Stephen Lamm slamm at yahoo-inc.com
Tue May 6 16:22:13 UTC 2003


On 06/05/03 21:51 +1000, Bradley Baetz <bbaetz at acm.org> wrote:
> On Sat, May 03, 2003 at 11:37:05PM +1000, Bradley Baetz wrote:
> > 
> > b) The function has a prototype (For GetFormat, $;$$ would be used)
> > _and_ its not being called like &GetFormat which bypasses prototypes
> > (and its a function, not a method, because methods don't care about
> > prototypes); or
> 
> So, as a followup to this, I'd like to recommend that we prototype stuff
> where possible. This isn't possible from any required file (because
> thats a runtime thing, not a compile time thing), and most of our
> modules are OO things which also don't work with prototypes, but there
> is stuff which can be handled that way.
> 
> Thoughts?
> 
> Bradley

Prototypes are good when you want a function to behave like a built-in.
They are not meant for type checking. They should probably only be
used where needed.

Here is a good explanation of "Prototypes in Perl" by Tom Christiansen:

http://www.perl.com/pub/a/language/misc/fmproto.html

-slamm



More information about the developers mailing list