modperl-2.0/ModPerl-Registry> t/TEST perlrun_require
I get
Subroutine whatever redefined at .../t/cgi-bin/lib.pl line 2.
warnings. I know why do we get this warning, but I fail to shut it down by adding: no warnings 'redefine' in t/cgi-bin/perlrun_require.pl:
Index: t/cgi-bin/perlrun_require.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/perlrun_require.pl,v
retrieving revision 1.1
diff -u -r1.1 perlrun_require.pl
--- t/cgi-bin/perlrun_require.pl 6 Jan 2003 10:42:38 -0000 1.1
+++ t/cgi-bin/perlrun_require.pl 19 Dec 2003 02:12:08 -0000
@@ -6,7 +6,11 @@
my $vars = Apache::Test::config()->{vars};
my $require = catfile $vars->{serverroot}, 'cgi-bin', 'lib.pl';-require $require;
+# ModPerl::PerlRun resets %INC, after compiling the script
+{
+ no warnings 'redefine';
+ require $require;
+}print "Content-type: text/plain\n\n";
it still warns. Only if I add this directive to the required file the warning disappears:
Index: t/cgi-bin/lib.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/lib.pl,v
retrieving revision 1.1
diff -u -r1.1 lib.pl
--- t/cgi-bin/lib.pl 6 Jan 2003 10:42:38 -0000 1.1
+++ t/cgi-bin/lib.pl 19 Dec 2003 02:13:58 -0000
@@ -1,2 +1,3 @@
-sub whatever { return 1;}
+no warnings 'redefine';
+sub whatever { return 1; }
1;something weird is going on.
I'd have thought that perl may have decided this is a constant sub, but it's not (no () proto) and warning doesn't say it's a constant... Hints?
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
