summaryrefslogtreecommitdiff
path: root/TestInit.pm
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-20 10:33:23 +0200
committerNicholas Clark <nick@ccl4.org>2011-06-22 22:41:20 +0200
commitdb6ebcbf60ec41f9f5ff67500e4e7433e400f46d (patch)
tree984ee5329443c4696e9b4db085d2275290fd9fda /TestInit.pm
parent962ff9139336a4a2799d553342c7401121cba884 (diff)
downloadperl-db6ebcbf60ec41f9f5ff67500e4e7433e400f46d.tar.gz
In TestInit, inline new_inc() and set_opt() into import(), their only caller.
Diffstat (limited to 'TestInit.pm')
-rw-r--r--TestInit.pm49
1 files changed, 20 insertions, 29 deletions
diff --git a/TestInit.pm b/TestInit.pm
index c921686bac..5aadefe892 100644
--- a/TestInit.pm
+++ b/TestInit.pm
@@ -27,32 +27,6 @@ $VERSION = 1.04;
# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-07/msg00154.html
$ENV{PERL_CORE} = $^X;
-sub new_inc {
- if (${^TAINT}) {
- @INC = @_;
- } else {
- @INC = (@_, '.');
- }
-}
-
-sub set_opt {
- my $sep;
- if ($^O eq 'VMS') {
- $sep = '|';
- } elsif ($^O eq 'MSWin32') {
- $sep = ';';
- } else {
- $sep = ':';
- }
-
- my $lib = join $sep, @_;
- if (exists $ENV{PERL5LIB}) {
- $ENV{PERL5LIB} = $lib . substr $ENV{PERL5LIB}, 0, 0;
- } else {
- $ENV{PERL5LIB} = $lib;
- }
-}
-
sub import {
my $self = shift;
my @up_2_t = ('../../lib', '../../t');
@@ -118,10 +92,27 @@ sub import {
$^X = File::Spec::Functions::rel2abs($^X);
}
- new_inc(@new_inc);
- set_opt(@new_inc) if $setopt;
+ @INC = @new_inc;
+ push @INC, '.' unless ${^TAINT};
+
+ if ($setopt) {
+ my $sep;
+ if ($^O eq 'VMS') {
+ $sep = '|';
+ } elsif ($^O eq 'MSWin32') {
+ $sep = ';';
+ } else {
+ $sep = ':';
+ }
+
+ my $lib = join $sep, @new_inc;
+ if (exists $ENV{PERL5LIB}) {
+ $ENV{PERL5LIB} = $lib . substr $ENV{PERL5LIB}, 0, 0;
+ } else {
+ $ENV{PERL5LIB} = $lib;
+ }
+ }
}
$0 =~ s/\.dp$//; # for the test.deparse make target
1;
-