in reply to eval strings non reentrant?

Another problem that would have been solved with use strict. The problem is that the foo subroutine is not defined until the end of the definition, so your foo of the last line of the subroutine is compiled as a simple bareword text string constant instead of a recursive call. You get the initial call because your foo outside the subroutine call is in fact after the subroutine is defined.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: •Re: eval strings non reentrant?
by mutated (Monk) on Jun 01, 2004 at 19:40 UTC
    <hang head in shame>
    you're right of course adding () to the bareword foo made the problem go away, I though I had found the reason a bigger program that does much the same thing was failing it however report in $@ it however already has the () because two parameters are being passed to it, it sets $@ to
    Can't call method "gm" without a package or object reference at (eval 2) line 99.
    which leads me to believe now it's not the same problem at all..well that and there is a use strict in that one and it doesn't complain.


    daN.