perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <>
Subject Re: [book review] the fate of PERL_MARK_WHERE
Date Wed, 13 Sep 2000 02:11:56 GMT
On Sun, 10 Sep 2000, Stas Bekman wrote:

> What's the fate of PERL_MARK_WHERE build time option? I'm working thru the
> mod_perl build options for the book and I wonder whether this one should
> be documented or not.
> There will be probably more book review questions coming -- please help us
> to produce correctly documented things...
> Currently the guide says:
> Generally for C<Apache::Registry> scripts, the reported line number
> for warnings and errors that end up in the I<error_log> file is not
> correct.  This is due to the fact that C<Apache::Registry>
> auto-magically wraps the scripts running under its handler in special
> code that enables the caching of the compiled scripts.

that's not true in general, it's not what PERL_MARK_WHERE was
introduced for.  there is the Perl <<HEREDOC inside eval "" problem that
confuses the Perl current linenumber counter, i think newer Perls fix
> If configured with C<PERL_MARK_WHERE=1>, mod_perl will attempt to
> compensate for this effect and show the exact line which triggered the
> error or warning.

that's not true either.

if you look at perl_util.c:mod_perl_mark_where():

it returns if CopLINE(curcop), which means Perl knows the current
linenumber/filename.  otherwise it sets the filename to the given
message and name of the given subroutine (current callback) :

 sv_catpvf(GvSV(CopFILEGV(curcop)), "%s subroutine `%_'", where, name);

so you end up with a Perl error message like:

use of uninitialized value at registered cleanup subroutine My::cleanup

it is a kludge and will probably not exist in 2.0, nothing marked as
experimental (in Makefile.PL) should be documented in a book:

my %experimental = map { $_,1 } qw{

gosh, i forget what half of those even do :)

View raw message