If you are still keen on using prototypes after having read the above comments, I thought I would throw out the answer you were originally looking for.
Throw in a 'use diagnostics;' at the top of your code, and you will get the following:
(W prototype) You've called a function that has a prototype before the parser saw a definition or declaration for it, and Perl could not check that the call conforms to the prototype. You need to either add an early prototype declaration for the subroutine in question, or move the subroutine definition ahead of the call to get proper prototype checking. Alternatively, if you are certain that you're calling the function correctly, you may put an ampersand before the name to avoid the warning. See perlsub.
This is telling you to put a forward declaration in your code that tells perl what the prototype of the function is, and stick it before the first use the function.
sub readConfig ($$); # or whatever the prototype is
Check out perlsub for more details.
- Cees
In reply to Re: warning about prototypes too early?
by cees
in thread warning about prototypes too early?
by jcpunk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |