in reply to eval strings non reentrant?

Your first call to foo is not a function call because foo() is not defined at that point.

Try this (slightly cleaned up code):

my $e = 'my $i=0; sub foo{ print "$i foo\n"; if ($i < 10){ $i++; print "calling foo\n"; foo(); } } foo;'; eval "$e"; print $@,"\n";
Use strict would have told you this.

Joost.