InfiniteSilence has asked for the wisdom of the Perl Monks concerning the following question:

Pardon me if this question had been asked before, but I couldn't find it with search or SuperSearch. When I use Apache::Registry with (obviously) Apache on Windows and I use eval on a string, the line count of the program appears to increase whenever the program calls die():
Die on parsing .ini file eval: hello at (eval 972) line 2.
A second later with the same code:
Die on parsing .ini file eval: hello at (eval 978) line 2.
The line being eval'd is being read in from an INI file, but keeps increasing -- doing this:
if ($line=~/%%/){ $line=~s/%%(.+?)%%/$1/meegs; }
So, what gives?

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re: Eval line count with mod_perl
by merlyn (Sage) on Nov 22, 2006 at 03:52 UTC
    the line count of the program appears to increase
    Nope, look closer. The line count is always line 2. It's the sequential eval counter that is incrementing, as it should.

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

Re: Eval line count with mod_perl
by ikegami (Patriarch) on Nov 22, 2006 at 03:53 UTC

    the line count of the program appears to increase whenever the program calls die()

    No, the eval count increases whenever eval EXPR is called.

    Keep in mind that
    s/.../$1/gee
    is a shortcut for
    s/.../eval $1/ge