$spitshell >>$Makefile <<!GROK!THIS!
# Macros to invoke a copy of our fully operational perl during the build.
PERL_EXE = perl\$(EXE_EXT)
-RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib
+RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib -I.
!GROK!THIS!
;;
esac
$default and $default =~ s/^'(.*)'$/$1/; # Will be quoted on generation
-require 'regen/regen_lib.pl' if $opt_r;
+require './regen/regen_lib.pl' if $opt_r;
my $MASTER_CFG = "config_h.SH";
# Inclusive bounds on the main part of the file, $section == 1 below:
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
}
use Maintainers qw(%Modules get_module_files get_module_pat);
# This needs to be able to run from a clean checkout, hence assume only system
# perl, which may be too old to have autodie
-require 'Porting/pod_lib.pl';
+require './Porting/pod_lib.pl';
my $state = get_pod_metadata(1);
my (undef, $old_major, $old_minor) = @{$state->{delta_version}};
# plan9 => 'plan9/mkfile',
);
-require 'Porting/pod_lib.pl';
-require 'Porting/manifest_lib.pl';
+require './Porting/pod_lib.pl';
+require './Porting/manifest_lib.pl';
sub my_die;
# process command-line switches
} elsif ($_ eq 'T') {
$chdir = '..'
unless -f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext';
- @INC = 'lib';
+ @INC = qw/ lib . /;
$setopt = 1;
} else {
die "Unknown option '$_'";
chdir $workdir
or die "Couldn't chdir to '$workdir': $!";
}
-require 'regen/regen_lib.pl';
-require 'regen/embed_lib.pl';
+require './regen/regen_lib.pl';
+require './regen/embed_lib.pl';
#
# See database of global and static function prototypes in embed.fnc
use strict;
use Getopt::Long;
-require 'devel/devtools.pl';
+require './devel/devtools.pl';
our %opt = (
base => 0,
use Config;
use Time::HiRes qw( gettimeofday tv_interval );
-require 'devel/devtools.pl';
+require './devel/devtools.pl';
our %opt = (
debug => 0,
use Getopt::Long;
use Pod::Usage;
-require 'devel/devtools.pl';
+require './devel/devtools.pl';
our %opt = (
check => 1,
use strict;
use Getopt::Long;
-require 'parts/ppptools.pl';
+require './parts/ppptools.pl';
our %opt = (
mode => 'check',
################################################################################
use strict;
-require 'parts/ppptools.pl';
+require './parts/ppptools.pl';
if (@ARGV) {
my $file = pop @ARGV;
$CLASS = "Math::BigFloat";
$CALC = "Math::BigInt::BareCalc"; # backend
-require 't/bigfltpm.inc'; # all tests here for sharing
+require './t/bigfltpm.inc'; # all tests here for sharing
$CLASS = "Math::BigInt";
$CALC = "Math::BigInt::BareCalc"; # backend
-require 't/bigintpm.inc'; # perform same tests as bigintpm.t
+require './t/bigintpm.inc'; # perform same tests as bigintpm.t
is(Math::BigInt->config()->{lib}, 'Math::BigInt::BareCalc',
'Math::BigInt->config()->{lib}');
-require 't/mbimbf.inc';
+require './t/mbimbf.inc';
is(ref($e->{_e}->[0]), '', '$e->{_e}->[0] is a scalar');
}
-require 't/bigfltpm.inc'; # all tests here for sharing
+require './t/bigfltpm.inc'; # all tests here for sharing
#############################################################################
# all the other tests
-require 't/bigintpm.inc'; # all tests here for sharing
+require './t/bigintpm.inc'; # all tests here for sharing
our $CLASS;
$CLASS = 'Math::BigFloat';
-require 't/alias.inc';
+require './t/alias.inc';
our $CLASS;
$CLASS = 'Math::BigInt';
-require 't/alias.inc';
+require './t/alias.inc';
our $mbi = 'Math::BigInt';
our $mbf = 'Math::BigFloat';
-require 't/mbimbf.inc';
+require './t/mbimbf.inc';
# some tests that won't work with subclasses, since the things are only
# guaranteed in the Math::Big(Int|Float) (unless subclass chooses to support
our $CLASS;
$CLASS = 'Math::BigInt::Subclass';
-require 't/alias.inc';
+require './t/alias.inc';
$CLASS = "Math::BigFloat::Subclass";
$CALC = Math::BigFloat->config()->{lib}; # backend
-require 't/bigfltpm.inc'; # perform same tests as bigfltpm
+require './t/bigfltpm.inc'; # perform same tests as bigfltpm
###############################################################################
# Now do custom tests for Subclass itself
$CLASS = "Math::BigInt::Subclass";
$CALC = "Math::BigInt::Calc"; # backend
-require 't/bigintpm.inc'; # perform same tests as bigintpm
+require './t/bigintpm.inc'; # perform same tests as bigintpm
###############################################################################
# Now do custom tests for Subclass itself
$mbi = 'Math::BigInt::Subclass';
$mbf = 'Math::BigFloat::Subclass';
-require 't/mbimbf.inc';
+require './t/mbimbf.inc';
is(Math::BigInt->downgrade() || "", "",
qq/Math::BigInt->downgrade() || ""/);
-require 't/upgrade.inc'; # all tests here for sharing
+require './t/upgrade.inc'; # all tests here for sharing
. q| $z = $x->badd($y); $z|);
# not yet:
-#require 't/upgrade.inc'; # all tests here for sharing
+#require './t/upgrade.inc'; # all tests here for sharing
is(Math::BigFloat->config()->{with}, 'Math::BigInt::Calc',
'Math::BigFloat->config()->{with}');
-require 't/bigfltpm.inc'; # all tests here for sharing
+require './t/bigfltpm.inc'; # all tests here for sharing
pass();
# fails still too many tests
-#require 't/bigfltpm.inc'; # all tests here for sharing
+#require './t/bigfltpm.inc'; # all tests here for sharing
$CLASS = "Math::BigRat";
$CALC = "Math::BigInt::Calc"; # backend
-require 't/bigratpm.inc'; # all tests here for sharing
+require './t/bigratpm.inc'; # all tests here for sharing
can be C<require>d. FIONREAD ends up defined as a function in the
I<sys/ioctl.ph> file:
- require 'sys/ioctl.ph';
+ require './sys/ioctl.ph';
$size = pack("L", 0);
ioctl(FH, FIONREAD(), $size) or die "Couldn't call ioctl: $!\n";
numeric descriptor as with C<MHCONTEXT> above. But if you really have
to, you may be able to do this:
- require 'sys/syscall.ph';
+ require './sys/syscall.ph';
my $rc = syscall(SYS_close(), $fd + 0); # must force numeric
die "can't sysclose $fd: $!" unless $rc == -1;
This is more portable than the raw C<ioctl>, but not as
illustrative:
- require 'sys/ioctl.ph';
+ require './sys/ioctl.ph';
die "no TIOCGWINSZ " unless defined &TIOCGWINSZ;
open(my $tty_fh, "+</dev/tty") or die "No tty: $!";
unless (ioctl($tty_fh, &TIOCGWINSZ, $winsize='')) {
use Thread::Queue;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Queue;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Queue;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Queue;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Queue;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Semaphore;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Queue;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Semaphore;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Semaphore;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Thread::Semaphore;
if ($] == 5.008) {
- require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
+ require './t/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
use Config;
push @INC, '.';
if (-f 't/test.pl') {
- require 't/test.pl';
+ require './t/test.pl';
} else {
require '../../t/test.pl';
}
local($on) = @_;
require 'sizeof.ph';
- require 'sys/ioctl.ph';
+ require './sys/ioctl.ph';
ioctl(STDIN,&TIOCGETP,$sgttyb)
|| die "Can't ioctl TIOCGETP: $!";
sub set_cbreak {
local($on) = @_;
- require 'sys/ioctl.pl';
+ require './sys/ioctl.pl';
ioctl(STDIN,$TIOCGETP,$sgttyb)
|| die "Can't ioctl TIOCGETP: $!";
#!./perl
-use strict;
# quickie tests to see if h2ph actually runs and does more or less what is
# expected
#!./perl
chdir 't' if -d 't';
-@INC = '../lib';
+@INC = ( '.', '../lib' );
our $local_tests = 6;
require "../t/lib/common.pl";
#!./perl
chdir 't' if -d 't';
-@INC = '../lib';
+@INC = ( '.', '../lib' );
our $UTF8 = (${^OPEN} || "") =~ /:utf8/;
require "../t/lib/common.pl";
}
use constant PLATFORM => $ARGS{PLATFORM};
-require "$ARGS{TARG_DIR}regen/embed_lib.pl";
+require "./$ARGS{TARG_DIR}regen/embed_lib.pl";
# Is the following guard strictly necessary? Added during refactoring
# to keep the same behaviour when merging other code into here.
BEGIN {
my $Top = File::Spec->catdir($FindBin::Bin, File::Spec->updir);
chdir $Top or die "Can't chdir to $Top: $!";
- require 'Porting/pod_lib.pl';
+ require './Porting/pod_lib.pl';
}
die "$0: Usage: $0 [--quiet]\n"
chdir $workdir
or die "Couldn't chdir to '$workdir': $!";
}
-require 'regen/regen_lib.pl';
+require './regen/regen_lib.pl';
# MANIFEST itself is Unix style filenames, so we have to assume that Unix style
# filenames will work.
my $tap = $ARGV[0] && $ARGV[0] eq '--tap' ? '# ' : '';
foreach my $pl (map {chomp; "regen/$_"} <DATA>) {
- my @command = ($^X, $pl, @ARGV);
+ my @command = ($^X, '-I.', $pl, @ARGV);
print "$tap@command\n";
system @command
and die "@command failed: $?"
use v5.16.0;
use strict;
use warnings;
-require 'regen/regen_lib.pl';
-require 'regen/charset_translations.pl';
+
+BEGIN { unshift @INC, '.' }
+
+require './regen/regen_lib.pl';
+require './regen/charset_translations.pl';
# Generates the EBCDIC translation tables that were formerly hard-coded into
# utfebcdic.h
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
- require 'regen/embed_lib.pl';
+ require './regen/regen_lib.pl';
+ require './regen/embed_lib.pl';
}
my $SPLINT = 0; # Turn true for experimental splint support http://www.splint.org
# This script is normally invoked from regen.pl.
BEGIN {
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
push @INC, './lib';
}
use strict ;
# it will generate EBCDIC too. (TODO)
use strict;
use Encode;
-require 'regen/regen_lib.pl';
+require './regen/regen_lib.pl';
sub make_text {
my ($chrmap, $letter, $unpredictable, $nocsum, $size, $condition) = @_;
use strict;
use Devel::Tokenizer::C 0.05;
-require 'regen/regen_lib.pl';
+require './regen/regen_lib.pl';
my $h = open_new('keywords.h', '>',
{ by => 'regen/keywords.pl', from => 'its data',
#!perl -w
use strict;
-require 'regen/regen_lib.pl';
-require 'Porting/pod_lib.pl';
+require './regen/regen_lib.pl';
+require './Porting/pod_lib.pl';
use vars qw($TAP $Verbose);
# For processing later
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
}
my %mg =
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
unshift @INC, 'ext/ExtUtils-Miniperl/lib';
}
use v5.15.8;
use strict;
use warnings;
-require 'regen/regen_lib.pl';
-require 'regen/charset_translations.pl';
+require './regen/regen_lib.pl';
+require './regen/charset_translations.pl';
# This program outputs l1_charclass_tab.h, which defines the guts of the
# PL_charclass table. Each line is a bit map of properties that the Unicode
prop_invlist
prop_invmap search_invlist
);
-require 'regen/regen_lib.pl';
-require 'regen/charset_translations.pl';
+require './regen/regen_lib.pl';
+require './regen/charset_translations.pl';
# This program outputs charclass_invlists.h, which contains various inversion
# lists in the form of C arrays that are to be used as-is for inversion lists.
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
}
my $oc = open_new('opcode.h', '>',
# which define what bits in op_private have what meanings for each op.
# It populates %LABELS, %DEFINES, %FLAGS, %BITFIELDS.
-require 'regen/op_private';
+require './regen/op_private';
#use Data::Dumper;
#print Dumper \%LABELS, \%DEFINES, \%FLAGS, \%BITFIELDS;
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
}
use strict;
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
}
use strict;
sub DEBUG () { 0 }
$|=1 if DEBUG;
-require 'regen/regen_lib.pl';
-require 'regen/charset_translations.pl';
+require './regen/regen_lib.pl';
+require './regen/charset_translations.pl';
require "regen/regcharclass_multi_char_folds.pl";
=head1 NAME
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
}
use strict;
use strict;
use Config;
-require 'regen/regen_lib.pl';
+require './regen/regen_lib.pl';
my ($uconfig_h, $uconfig_h_new, $config_h_sh)
= ('uconfig.h', 'uconfig.h-new', 'config_h.SH');
use v5.16.0;
use strict;
use warnings;
-require 'regen/regen_lib.pl';
-require 'regen/charset_translations.pl';
+require './regen/regen_lib.pl';
+require './regen/charset_translations.pl';
use Unicode::UCD;
use charnames qw(:loose);
$VERSION = '1.37';
BEGIN {
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
push @INC, './lib';
}
use strict ;
use warnings;
use strict;
-BEGIN { require 'regen/regen_lib.pl'; }
+BEGIN { require './regen/regen_lib.pl'; }
my $bison = 'bison';
#!./perl
+BEGIN { unshift @INC, '.' }
+
chdir 't' if -d 't';
sub ok {
print "in mainline\n";
1;
--FILE--
+BEGIN { unshift @INC, '.' }
require abc;
do "abc.pm";
EXPECT
EOT
close $f;
-$r = runperl(prog => 'use Op_goto01; print qq[DONE\n]');
+$r = runperl(prog => 'BEGIN { unshift @INC, q[.] } use Op_goto01; print qq[DONE\n]');
is($r, "OK\nDONE\n", "goto within use-d file");
unlink_all "Op_goto01.pm";
use TestInit qw(T); # T is chdir to the top level
use strict;
-require 't/test.pl';
+require './t/test.pl';
find_git_or_skip('all');
# This is the subset of "pretty=fuller" that checkAUTHORS.pl actually needs:
use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
use strict;
-require 't/test.pl';
+require './t/test.pl';
my $source = find_git_or_skip('all');
chdir $source or die "Can't chdir to $source: $!";
use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
use strict;
-require 't/test.pl';
+require './t/test.pl';
my $source = find_git_or_skip('all');
chdir $source or die "Can't chdir to $source: $!";
use strict;
use Config;
-require 't/test.pl';
+require './t/test.pl';
plan(tests => 6);
use strict;
use Config;
-require 't/test.pl';
+require './t/test.pl';
if ( $Config{usecrosscompile} ) {
skip_all( "Not all files are available during cross-compilation" );
my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list'
and shift;
-require 'regen/embed_lib.pl';
+require './regen/embed_lib.pl';
# Look for functions that look like they could be diagnostic ones.
my @functions;
use strict;
use Config;
-require 't/test.pl';
+require './t/test.pl';
skip_all("Code to read symbols not ported to $^O")
if $^O eq 'VMS' or $^O eq 'MSWin32';
}
use TestInit qw(T); # T is chdir to the top level
-require 't/test.pl';
+require './t/test.pl';
skip_all("Cross-compiling, the entire source might not be available")
if $Config{usecrosscompile};
use strict;
use File::Spec;
-require 't/test.pl';
+require './t/test.pl';
find_git_or_skip('all');
my $devnull = File::Spec->devnull;
chdir '..';
}
@INC = qw(lib .); # Special @INC.
- require 't/test.pl';
+ require './t/test.pl';
}
use strict;
use TestInit qw(T); # T is chdir to the top level
use strict;
use warnings;
-require 't/test.pl';
+require './t/test.pl';
my @porting_files;
open my $man, "MANIFEST" or die "Can't open MANIFEST: $!";
use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
use strict;
-require 'regen/regen_lib.pl';
-require 't/test.pl';
+require './regen/regen_lib.pl';
+require './t/test.pl';
$::NO_ENDING = $::NO_ENDING = 1;
if ( $^O eq "VMS" ) {
}
foreach (@progs) {
- my $command = "$^X $_ --tap";
+ my $command = "$^X -I. $_ --tap";
system $command
and die "Failed to run $command: $?";
}
use TestInit qw(T); # T is chdir to the top level
use strict;
-require 't/test.pl';
+require './t/test.pl';
# It turns out that, since the default @INC will include your old 5.x libs, if
# you have them, the Porting utils might load a library that no longer compiles
# NOTE - Do not put quotes in the code!
# NOTE - We have to triple escape the backref in the pattern below.
my $code='
- BEGIN{require q(test.pl);}
+ BEGIN{require q(./test.pl);}
watchdog(3);
for my $len (1 .. 20) {
my $eights= q(8) x $len;
# #123562]
my $code='
- BEGIN{require q(test.pl);}
+ BEGIN{require q(./test.pl);}
use Encode qw(_utf8_on);
# \x80 and \x41 are continuation bytes in their respective
# character sets
my ($expr, $expect, $test_name, $cap1)= @$tuple;
# avoid quotes in this code!
my $code='
- BEGIN{require q(test.pl);}
+ BEGIN{require q(./test.pl);}
watchdog(3);
my $status= eval(q{ !(' . $expr . ') ? q(failed) : ' .
($cap1 ? '($1 ne q['.$cap1.']) ? qq(badmatch:$1) : ' : '') .
my @default_inc = split /\n/, $out;
-is ($default_inc[-1], '.', '. is last in @INC');
+ok ! grep { $_ eq '.' } @default_inc, '. is not in @INC';
+#is ($default_inc[-1], '.', '. is last in @INC');
my $sep = $Config{path_sep};
foreach (['nothing', ''],
SWTESTPM
close $f or die "Could not close: $!";
$r = runperl(
- switches => [ "-M$package" ],
+ switches => [ "-I.", "-M$package" ],
prog => '1',
);
is( $r, "<$package>", '-M' );
$r = runperl(
- switches => [ "-M$package=foo" ],
+ switches => [ "-I.", "-M$package=foo" ],
prog => '1',
);
is( $r, "<$package><foo>", '-M with import parameter' );
is( $r, '', '-m' );
}
$r = runperl(
- switches => [ "-m$package=foo,bar" ],
+ switches => [ "-I.", "-m$package=foo,bar" ],
prog => '1',
);
is( $r, "<$package><foo><bar>", '-m with import parameters' );
$runperl = "$ENV{PERL_RUNPERL_DEBUG} $runperl";
}
unless ($args{nolib}) {
- $runperl = $runperl . ' "-I../lib"'; # doublequotes because of VMS
+ $runperl = $runperl . ' "-I../lib" "-I." '; # doublequotes because of VMS
}
if ($args{switches}) {
local $Level = 2;
open my $fh, '>', $tmpfile or die "Cannot open >$tmpfile: $!";
print $fh q{
BEGIN {
+ push @INC, '.';
open STDERR, '>&', STDOUT
or die "Can't dup STDOUT->STDERR: $!;";
}
# attempting to move the work from them to the extension directories and
# ExtUtils::MakeMaker.
-require 'regen/regen_lib.pl';
+require './regen/regen_lib.pl';
my $target = 'utils/Makefile';
print "Extracting $target (with variable substitutions)\n";
#!/usr/local/bin/perl
require 'syscall.ph';
- require 'sys/time.ph';
- require 'sys/resource.ph';
+ require './sys/time.ph';
+ require './sys/resource.ph';
$ru = "\0" x &rusage'sizeof();
next if $_ eq 'XS/APItest';
next if $_ eq 'XS/Typemap';
# VMS$ perl -e "eval ""require \""Devel/DProf.pm\"";"" print $@"
- # \NT> perl -e "eval \"require 'Devel/DProf.pm'\"; print $@"
+ # \NT> perl -e "eval \"require './Devel/DProf.pm'\"; print $@"
# DProf: run perl with -d to use DProf.
# Compilation failed in require at (eval 1) line 1.
eval " require \"$_.pm\"; ";