in reply to Re: How to exit subroutine and go to Beginning of CGI Script?
in thread How to exit subroutine and go to Beginning of CGI Script?

One method is to make the "main" part of your code into a subroutine itself such that to start at the beginning again, you simply call that routine.

This will lead to memory exhaustion under some circumstances.

Question: is tail-recursion possible in Perl?

  • Comment on Re: Re: How to exit subroutine and go to Beginning of CGI Script?

Replies are listed 'Best First'.
Re: Re: Re: How to exit subroutine and go to Beginning of CGI Script?
by duff (Parson) on Dec 19, 2003 at 19:42 UTC

    It could lead to memory exhaustion. But then there's always goto &main; (or more likely @_=(); goto &main;). This form of goto isn't quite as evil as goto LABEL or goto EXPR.

    P.S. Of course tail-recursion is possible, though not always desirable :)