in reply to eval BLOCK with runtime-loaded code?

A simple change should help you:

Change

sub { eval $$scrref };

into

eval "sub { $$scrref }";

That way, the eval only happens once.

Replies are listed 'Best First'.
Re^2: eval BLOCK with runtime-loaded code?
by GoCool (Scribe) on Jul 22, 2005 at 17:25 UTC
    but don't forget that:

    "... no matter how many times you execute that particular line (unless you're in an eval("...")), $coderef will still have a reference to the same anonymous subroutine."

    as quoted in this link under perldoc.