in reply to Re: Confused about typeglobs and references
in thread Confused about typeglobs and references
Don't use prototypes unless you can clearly explain why you're using them. Their only significant benefit in Perl is to change how you call a subroutine, but they are so filled with caveats and gotchas that they're easy to use incorrectly. Read this recent thread on prototypes for more info, particularly the short and accurate explanation by Dominus.
As for using ref: I hate to say it, but I'd avoid that also. Take a look at code on this site that uses ref and you'll find that most (not all!) instances of it are indicative of some design flaw in the code.
Cheers,
Ovid
Join the Perlmonks Setiathome Group.
New address of my CGI Course.
|
|---|