You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "Philip M. Gollucci" <pg...@p6m7g8.com> on 2005/09/09 11:19:57 UTC

Apache2::Status - Loaded Modules output

Hi,

Because of the lines in lib/mod_perl2.pm
# this stuff is here to assist back compat
# basically, if you
#  PerlModule mod_perl2
# or take similar steps to load mod_perl2 at
# startup you are protected against loading mod_perl.pm
# (either 1.0 or 1.99) at a later time by accident.
$mod_perl::VERSION = $mod_perl2::VERSION;
$INC{"mod_perl.pm"} = __FILE__;

Apache2::Status Loaded Modules output displays
mod_perl	2.000002	Mon Aug 22 22:55:02 2005	/usr/home/pgollucci/dev/apps/mod_perl-2.0.2/lib/mod_perl2.pm
mod_perl2	2.000002	Mon Aug 22 22:55:02 2005	/usr/home/pgollucci/dev/apps/mod_perl-2.0.2/lib/mod_perl2.pm

Which is confusing to me at least.

This suppresses the printing of mod_perl.pm which will be especially confusing if you have mp1 and mp2 in the same lib tree.

Index: Status.pm
===================================================================
--- Status.pm   (revision 279713)
+++ Status.pm   (working copy)
@@ -210,6 +210,7 @@
          next if $file =~ m:^/:;
          next unless $file =~ m:\.pm:;
          next unless $INC{$file}; #e.g. fake Apache2/TieHandle.pm
+        next if $file eq 'mod_perl.pm';

          no strict 'refs';
          (my $module = $file) =~ s,/,::,g;


-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache2::Status - Loaded Modules output

Posted by Stas Bekman <st...@stason.org>.
Philip M. Gollucci wrote:
>> use File::Spec::Functions;
>> $INC{"mod_perl.pm"} = File::Spec::Functions::devnull();
> 
> I'm fine with the above, but I still think in this particular case, 
> Apache2::Status needs a change too
> now, we would display
> mod_perl    2.000002    Sun Sep 11 23:18:13 2005    /dev/null
> mod_perl2    2.000002    Sun Sep 11 23:16:09 2005    
> /usr/home/pgollucci/dev/apps/mod_perl-2.0.2/prefork/lib/mod_perl2.pm
> 
> My whole attempt was to *remove* the mod_perl line all together.
> 
> So how about:

works for me :)

+1

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://mailchannels.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache2::Status - Loaded Modules output

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
> use File::Spec::Functions;
> $INC{"mod_perl.pm"} = File::Spec::Functions::devnull();
I'm fine with the above, but I still think in this particular case, Apache2::Status needs a change too
now, we would display
mod_perl	2.000002	Sun Sep 11 23:18:13 2005	/dev/null
mod_perl2	2.000002	Sun Sep 11 23:16:09 2005	/usr/home/pgollucci/dev/apps/mod_perl-2.0.2/prefork/lib/mod_perl2.pm

My whole attempt was to *remove* the mod_perl line all together.

So how about:

pgollucci@pgollucci.internal.liquidation.com /home/pgollucci/dev/repos/asf/perl/modperl/trunk/lib rv=0 150 >svn diff 
mod_perl2.pm Apache2/Status.pm
Index: mod_perl2.pm
===================================================================
--- mod_perl2.pm        (revision 279773)
+++ mod_perl2.pm        (working copy)
@@ -16,6 +16,7 @@

  use 5.006;
  use strict;
+use File::Spec::Functions;

  BEGIN {
      our $VERSION = "2.000002";
@@ -48,7 +49,7 @@
  # startup you are protected against loading mod_perl.pm
  # (either 1.0 or 1.99) at a later time by accident.
  $mod_perl::VERSION = $mod_perl2::VERSION;
-$INC{"mod_perl.pm"} = __FILE__;
+$INC{"mod_perl.pm"} = File::Spec::Functions::devnull();

  1;
  __END__
Index: Apache2/Status.pm
===================================================================
--- Apache2/Status.pm   (revision 279773)
+++ Apache2/Status.pm   (working copy)
@@ -210,6 +210,7 @@
          next if $file =~ m:^/:;
          next unless $file =~ m:\.pm:;
          next unless $INC{$file}; #e.g. fake Apache2/TieHandle.pm
+        next if $module eq 'mod_perl';

          no strict 'refs';
          (my $module = $file) =~ s,/,::,g;


-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Apache2::Status - Loaded Modules output

Posted by Stas Bekman <st...@stason.org>.
Philip M. Gollucci wrote:
> Hi,
> 
> Because of the lines in lib/mod_perl2.pm
> # this stuff is here to assist back compat
> # basically, if you
> #  PerlModule mod_perl2
> # or take similar steps to load mod_perl2 at
> # startup you are protected against loading mod_perl.pm
> # (either 1.0 or 1.99) at a later time by accident.
> $mod_perl::VERSION = $mod_perl2::VERSION;
> $INC{"mod_perl.pm"} = __FILE__;

May be mod_perl.pm in mp1 should be changed to croak if it sees 
mod_perl2.pm loaded, and the other way around? But since mp1 is not 
released too often nowaways, how about this alternative solution:
use File::Spec::Functions;
$INC{"mod_perl.pm"} = File::Spec::Functions::devnull();

> Apache2::Status Loaded Modules output displays
> mod_perl    2.000002    Mon Aug 22 22:55:02 2005    
> /usr/home/pgollucci/dev/apps/mod_perl-2.0.2/lib/mod_perl2.pm
> mod_perl2    2.000002    Mon Aug 22 22:55:02 2005    
> /usr/home/pgollucci/dev/apps/mod_perl-2.0.2/lib/mod_perl2.pm
> 
> Which is confusing to me at least.
> 
> This suppresses the printing of mod_perl.pm which will be especially 
> confusing if you have mp1 and mp2 in the same lib tree.
> 
> Index: Status.pm
> ===================================================================
> --- Status.pm   (revision 279713)
> +++ Status.pm   (working copy)
> @@ -210,6 +210,7 @@
>          next if $file =~ m:^/:;
>          next unless $file =~ m:\.pm:;
>          next unless $INC{$file}; #e.g. fake Apache2/TieHandle.pm
> +        next if $file eq 'mod_perl.pm';
> 
>          no strict 'refs';
>          (my $module = $file) =~ s,/,::,g;

-0, I'd rather see the cause removed than trying to go after every module 
that relies on the misleading info.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://mailchannels.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org