Philippe M. Chiasson wrote:
As has been requested for quite a while, this patch _finally_ makes <Perl> sections
strict by default.
Index: todo/release =================================================================== RCS file: /home/cvs/modperl-2.0/todo/release,v retrieving revision 1.29 diff -u -I$Id -r1.29 release --- todo/release 9 Jun 2004 14:46:22 -0000 1.29 +++ todo/release 28 Jun 2004 20:42:57 -0000 @@ -74,10 +74,6 @@ http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=106074969831522&w=2 owner: gozer
-* $Apache::Server::StrictPerlSections should be 1 by default (and docs - updated) - owner: gozer - * Fixing Apache->warn("foo")
Report: http://mathforum.org/epigone/modperl-dev/noxtramcay/[EMAIL PROTECTED]
Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.392 diff -u -I$Id -r1.392 Changes --- Changes 27 Jun 2004 21:26:45 -0000 1.392 +++ Changes 28 Jun 2004 20:42:58 -0000 @@ -12,6 +12,9 @@
=item 1.99_15-dev
+<Perl> sections are now strict by default and can be disabled by +setting $Apache::Server::StrictPerlSections = 0; [Gozer]
I think we need to choose a better name for StrictPerlSections. "Strict" implies 'use strict' to most perl users, so it's a misleading name. Also may be it's better to have the feature name as a prefix and the sub-feature as a postfix. i.e. $Apache::Server::PerlSectionsStrict. For example use $Apache::Server::PerlSectionsNonFatal (not reversed logic), so only when it's set to 1, the errors will be non-fatal.
I like $Apache::Server::PerlSectionsNonFatal = 1;
Moreover now that I think about it I'm not quite sure why in the world someone will want to turn this feature on. Can you please remind me why was it added at all? If someone wants that badly then can just wrap the whole section in the eval {} block.
As far as I can tell/remember, this is simply a mp1 feature that I wanted to preserve when porting the <Perl> code to mp2.
I agree that it doesn't add much functionnality that an eval {} block wouldn't
allow (except maybe if the code _doesn't_ compile at all.How about this? - Implement PerlSectionsNonFatal = 1 - Deprecate StrictPerlSections with a warning, unless MP_COMPAT_1X is selected ?
Also here:
modperl_log_warn(s, apr_psprintf(p, "Syntax error at %s:%d %s",
directive->filename,
directive->line_num,
SvPVX(ERRSV)));
we should probably drop the word: Syntax, since it can be pretty much any error. Moreover the order of elements in the error is different from perl (and here we give a perl error). So I suggest:
modperl_log_warn(s, apr_psprintf(p, "%s at %s line %d", SvPVX(ERRSV), directive->filename, directive->line_num));
but may be it's totally irrelevant if we drop that feature completely.
-- -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
signature.asc
Description: OpenPGP digital signature
