The eval number changes quite often, but not the line number, so I thnk that means the same line of the same eval'ed code is failing.
Probably, yes.
How do I track down where the eval is happening?
You can use one of the routines from Carp which produce a stack trace. Attach either confess() or cluck() to $SIG{__WARN__} — the latter is fatal, the former a warning.
#!perl -w use Carp; local $SIG{__WARN__} = \&Carp::cluck; sub foo { my($x, $y) = @_; return eval '$x+$y'; } print foo(5); # should get 2 arguments;
Use of uninitialized value in addition (+) at (eval 1) line 1. eval '$x+$y ;' called at test.pl line 6 main::foo(5) called at test.pl line 8 5

p.s. For some reason unclear to me, I get no output using \&Carp::confess. Any hints on why are welcomed.


In reply to Re: tracing eval by bart
in thread tracing eval by leriksen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.