Open p5pRT opened 22 years ago
Consider the following module.
---[begin: testmod.pm]--- package testmod;
use strict; use warnings; use AutoLoader qw(AUTOLOAD);
1;
__END__
sub test_routine {
my $foo = "foo"; print "$typo\n";
} ---[end: testmod.pm]---
If one is to\, after creating this file\, run perl -c against it\, it compiles correctly\, as opposed to getting the message:
Global symbol "$typo" requires explicit package name at testmod.pm line 14.
as one might expect when using strict. Without strict\, you also do not get the usual warning:
Name "testmod::typo" used only once: possible typo at testmod.pm line 14.
I can understand that this is likely the case as code after the __END__ token is highly irregular\, except in terms of AutoSplit. The work around\, of course\, is to comment out the __END__ token so that strict and warnings will also consider the additional code\, and uncomment the __END__ token after debugging to re-enable AutoSplit'ing.
What's more\, if you were to AutoSplit the module a la MakeMaker and use it\, the strictures and warnings continue to not function. The module is use'd\, and test_routine would be AutoLoad'd without any notice of an error\, though strict and warnings are in place.
It seems to me that either AutoSplit should be changed to not expect code to be placed after the __END__ token\, or that the strict and warnings pragmas be applied to code after the __END__ token\, and subsequently upon being AutoLoad'd.
If these are known problems\, or non-issues\, I apologize for taking up your time with this bug report.
Thank you for your consideration. If I can be of further service\, please do not hesitate to contact me.
--John West
-- John West- Systems Consultant\, Perl Monk jwest@cptech.com Corporate Technologies\, Inc. 781-273-4100\, x118
This problem is unchanged in 5.10.
Would it be possible to disable the use of the split hierarchy on a special flag\, say -/nosplit? This would be useful e.g. in conjunction with 'perl -c' and would fall back to using the plain module file(s).
I am assuming that this could restore the "use (strict|warnings)" functionality...
Migrated from rt.perl.org#7825 (status was 'open')
Searchable as RT7825$