Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
perl5 "prototyping": why?by rvosa (Curate) |
on Jul 07, 2005 at 20:37 UTC ( [id://473221]=perlquestion: print w/replies, xml ) | Need Help?? |
rvosa has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks,
I am trying to use a module that has a lot of "prototyped" subs, along the lines of (yes, I *really* saw this one in the wild): As it happens, I'm getting messages of the sort: 'Can't use string ("1") as a HASH ref while "strict refs" in use ...' I fear this may be due not to what I'm doing - I'm not sending a string, nor is the sub supposed to receive a hash ref - but rather because of quirky behavior of args in prototyped subroutines. I am tempted to just remove the prototypes, because they don't seem to be doing much anyway. It's not like they are for typechecking. What's the point of them, again? Can you give me an example of how I will shoot myself in the foot when I go ahead and remove the prototypes? Thanks!
Back to
Seekers of Perl Wisdom
|
|