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

main::main() called too early to check prototype

could someone explain this error to me. With the -w set it reports it. I am just wondering why.

Replies are listed 'Best First'.
Re: main() called to soon warning
by Aristotle (Chancellor) on Sep 07, 2002 at 23:15 UTC
    Because you're calling main in some place of the file before you define it with sub main (..). That call up there is not being prototype checked. Please note that "prototypes" in Perl are not what you very probably think they are. You should consider not using them. See a recent discussion as well as Tom Christiansen's exhaustive explanation about them.

    Makeshifts last the longest.