# Due to a bug in older versions of MakeMaker & Test::Harness, we must
# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(. ./blib/lib ./blib/arch);
+
+my $test_file;
+if($ENV{PERL_CORE}) {
+ chdir 't';
+ @INC = '../lib';
+ use File::Spec ();
+ $test_file = File::Spec->catfile(qw(.. lib CGI t), "upload_post_text.txt");
+} else {
+ use lib qw(. ./blib/lib ./blib/arch);
+ $test_file = "t/upload_post_text.txt";
+}
use strict;
{
local *STDIN;
- open STDIN, '<t/upload_post_text.txt'
+ open STDIN, "< $test_file"
or die 'missing test file t/upload_post_text.txt';
binmode STDIN;
$q = CGI->new;
# Due to a bug in older versions of MakeMaker & Test::Harness, we must
# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(. ./blib/lib ./blib/arch);
+
+my $test_file;
+if($ENV{PERL_CORE}) {
+ chdir 't';
+ @INC = '../lib';
+ use File::Spec ();
+ $test_file = File::Spec->catfile(qw(.. lib CGI t), "upload_post_text.txt");
+} else {
+ use lib qw(. ./blib/lib ./blib/arch);
+ $test_file = "t/upload_post_text.txt";
+}
use strict;
{
local *STDIN;
- open STDIN, '<t/upload_post_text.txt'
+ open STDIN, "< $test_file"
or die 'missing test file t/upload_post_text.txt';
binmode STDIN;
$q = CGI->new;