in reply to "Called to early to check prototype"

Of course, I'm not sure where the problem is, since you're not using a prototype in the code you show. Anyway:

Probably the best way: by getting rid of the prototype.

Failing that: predeclare the sub somewhere at the top of the script (that is, anywhere so long as it's above its first use), as in

sub foo($$);

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^2: "Called to early to check prototype"
by superfrink (Curate) on Aug 21, 2004 at 04:51 UTC
    Update: I'm pretty sure the warning is due to the code calling ParseHomePage() before it has been defined so the interpreter can't check the argument list is acceptable.

    If you run "perldoc perlsub" (in your shell) or just go to perlsub you can read how prototypes work.

    I often write scripts like the following but you can put the actual subroutine code at the top before you call it instead of the declaration.
    #!/usr/bin/perl use strict; # subroutines --------------- sub abc($$); # abc() does x,y,z # main() -------------------- ... # subroutines --------------- sub abc($$) { # abc() does x,y,z # inputs: ... # returns: ... # function code here }