Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mod_perl2 sets $^X to httpd - deal with that.

  • Loading branch information...
commit 2ff29b7ccc94afdd0423610ddac395587eb66f6a 1 parent 0f33c2c
@pjcj authored
Showing with 26 additions and 16 deletions.
  1. +26 −16 lib/Devel/Cover.pm
View
42 lib/Devel/Cover.pm
@@ -105,25 +105,35 @@ BEGIN
($ENV{PERL5OPT} || "") =~ /Devel::Cover/;
*OUT = $ENV{DEVEL_COVER_DEBUG} ? *STDERR : *STDOUT;
- eval
- {
- local %ENV = %ENV;
- # Clear *PERL* variables, but keep PERL5?LIB for local::lib environments
- /perl/i and !/^PERL5?LIB$/ and delete $ENV{$_} for keys %ENV;
- my $cmd = "$^X -MData::Dumper -e " . '"print Dumper \@INC"';
- my $VAR1;
- # print STDERR "Running [$cmd]\n";
- eval `$cmd`;
- # TODO - Devel::Cover: Error getting @INC: Insecure dependency in ``
- # while running with -T switch at .../Devel/Cover.pm line 116.
- @Inc = @$VAR1;
- };
- if ($@)
+ if ($^X =~ /httpd$/)
{
- print STDERR __PACKAGE__, ": Error getting \@INC: $@\n",
- "Reverting to default value for Inc.\n";
+ # mod_perl < 2.0.8
@Inc = @Devel::Cover::Inc::Inc;
}
+ else
+ {
+ eval
+ {
+ local %ENV = %ENV;
+ # Clear *PERL* variables, but keep PERL5?LIB for local::lib
+ # environments
+ /perl/i and !/^PERL5?LIB$/ and delete $ENV{$_} for keys %ENV;
+ my $cmd = "$^X -MData::Dumper -e " . '"print Dumper \@INC"';
+ my $VAR1;
+ # print STDERR "Running [$cmd]\n";
+ eval `$cmd`;
+ # TODO - Devel::Cover: Error getting @INC: Insecure dependency in ``
+ # while running with -T switch at .../Devel/Cover.pm line 116.
+ @Inc = @$VAR1;
+ };
+ if ($@)
+ {
+ print STDERR __PACKAGE__, ": Error getting \@INC: $@\n",
+ "Reverting to default value for Inc.\n";
+ @Inc = @Devel::Cover::Inc::Inc;
+ }
+ }
+
@Inc = map { -d $_ ? ($_ eq "." ? $_ : Cwd::abs_path($_)) : () } @Inc;
@Ignore = ("/Devel/Cover[./]") unless $Self_cover = $ENV{DEVEL_COVER_SELF};
Please sign in to comment.
Something went wrong with that request. Please try again.