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

In a warning message, what does it mean to be at (eval 6)??? I have a program that produces the following warning message.

Use of uninitialized value in concatenation (.) or string at (eval 6) line 29.

Obviously, I was expecting to see a file name. When I get the stack trace, it looks like the warning message occurs when my program calls CGI::header with no arguments.

I would really like to look at the code at (eval 6) line 29. But I'm not sure where this is.

Replies are listed 'Best First'.
Re: Warn stack trace lost its way?
by BrowserUk (Patriarch) on Apr 29, 2004 at 16:23 UTC
Re: Warn stack trace lost its way?
by gellyfish (Monsignor) on Apr 29, 2004 at 16:33 UTC

    Perl does not know what the filename of the code it is running when that code is being 'eval'ed

    Running the code shouold show you what is going on:

    eval "warn 'Rarr'"; eval "warn 'Rarr'"; eval "warn 'Rarr'"; eval "warn 'Rarr'"; eval "warn 'Rarr'"; eval "warn 'Rarr'";
    the problem you will have with CGI.pm is that it uses run-time eval()ing to reduce it's compile time upfront.

    /J\