as "./perl", the $^X will be "../perl", not "./perl".
p4raw-id: //depot/perl@13255
#!./perl
BEGIN {
- chdir '..' if -d '../pod' && -d '../t';
+ if (-d '../pod' && -d '../t') {
+ require File::Spec;
+ my ($v,$d,$f) = File::Spec->splitpath($^X);
+ $^X = File::Spec->catfile(File::Spec->curdir, $f)
+ if $^X eq File::Spec->catfile(File::Spec->updir, $f);
+ chdir '..';
+ }
@INC = 'lib';
}