4 if ( $ENV{PERL_CORE} ) {
6 @INC = ( '../lib', 'lib' );
13 # Test that options in PERL5LIB and PERL5OPT are propogated to tainted
17 use Test::More ( $^O eq 'VMS' ? ( skip_all => 'VMS' ) : ( tests => 3 ) );
22 my $lib_path = join( ', ', map "'$_'", grep !ref, grep defined, @INC );
25 my ( $test_template, @args ) = @_;
27 my $test_file = 'temp_test.tmp';
29 open TEST, ">$test_file" or die $!;
30 printf TEST $test_template, @args;
33 my $p = TAP::Parser->new( { source => $test_file } );
41 local $ENV{PERL5LIB} = join $Config{path_sep}, grep defined, 'wibble',
43 run_test_file( <<'END', $lib_path );
46 BEGIN { unshift @INC, ( %s ); }
47 use Test::More tests => 1;
49 ok grep(/^wibble$/, @INC) or diag join "\n", @INC;
54 my $perl5lib = $ENV{PERL5LIB};
56 local $ENV{PERLLIB} = join $Config{path_sep}, grep defined, 'wibble',
58 run_test_file( <<'END', $lib_path );
61 BEGIN { unshift @INC, ( %s ); }
62 use Test::More tests => 1;
64 ok grep(/^wibble$/, @INC) or diag join "\n", @INC;
69 local $ENV{PERL5LIB} = join $Config{path_sep}, @INC;
70 local $ENV{PERL5OPT} = '-Mstrict';
71 run_test_file(<<'END');
75 print $INC{'strict.pm'} ? "ok 1\n" : "not ok 1\n";