You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2000/09/10 22:05:49 UTC
[book review] the fate of PERL_MARK_WHERE
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:
=head4 PERL_MARK_WHERE
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.
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.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com perl.org apache.org
Re: [book review] the fate of PERL_MARK_WHERE
Posted by Doug MacEachern <do...@covalent.net>.
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:
>
> =head4 PERL_MARK_WHERE
>
> 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
this.
> 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{
PERL_AUTOPRELOAD
PERL_DSO_UNLOAD
PERL_STARTUP_DONE_CHECK
PERL_RUN_XS
PERL_MARK_WHERE
DO_INTERNAL_REDIRECT
PERL_TIE_SCRIPTNAME
PERL_STASH_POST_DATA
XS_IMPORT
PERL_SAFE_STARTUP
PERL_DEFAULT_OPMASK
PERL_ORALL_OPMASK
};
gosh, i forget what half of those even do :)