in reply to problem prototyping a self-recursing function

The bigger problem is you're calling the function before you define it, so that call doesn't use the prototype either. Just declare your function ahead of time:
sub foo ($$$); # your code sub foo ($$$) { # ... foo(...) if ...; # ... }

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: problem prototyping a self-recursing function
by Rex(Wrecks) (Curate) on Dec 07, 2001 at 03:00 UTC
    Exactly, buy definition prototyping is predaclaring functions and the allowable arguements for that function.

    What you were doing is only defining them and the args at the point you use them, that's only half the picture. Predefining them allows the complier (in this case the interpreter) to make certain assumptions about the calls to the function and error out if they are wrong.

    One other point that should be made is that there are reasons NOT to prototype in Perl. Do a search on this site and you will come up with several nodes that debate that very point.

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!