John E. Malmberg [Sun, 11 Nov 2007 17:42:46 +0000 (11:42 -0600)]
From: "John E. Malmberg" <wb8tyw@qsl.net>
Message-id: <
47379376.6070809@qsl.net>
With variations to make it cross-platform.
p4raw-id: //depot/perl@32279
BEGIN {
+ require File::Spec;
chdir 't' if -d 't';
- unshift @INC => '../lib';
+ # May be doing dynamic loading while @INC is all relative
+ unshift @INC => File::Spec->rel2abs('../lib');
$SIG{'__WARN__'} = sub { $warn_msg = $_[0]; warn "# $_[0]"; }
}
BEGIN {
+ require File::Spec;
chdir 't' if -d 't';
- unshift @INC => '../lib';
+ # May be doing dynamic loading while @INC is all relative
+ my $lib = File::Spec->rel2abs('../lib');
+ $lib = $1 if $lib =~ m/(.*)/;
+ unshift @INC => $lib;
}
use Config;