HeffaK has asked for the wisdom of the Perl Monks concerning the following question:

I got this error message...
main::collect called too early to check prototype at ...
What does it mean?
Thanks!
Heffa K

Replies are listed 'Best First'.
Re: What does called to early mean?
by KM (Priest) on Apr 25, 2001 at 00:06 UTC
    From perldiag:

    =item %s() called too early to check prototype
    
    (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 L<perlsub>.
    

    Cheers,
    KM