diff options
author | Michael G. Schwern <schwern@pobox.com> | 2001-12-06 17:45:44 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-07 03:05:38 +0000 |
commit | 130a7b3aa229167baeb66d349b459da7d43088ee (patch) | |
tree | 6b62dc61e7583356a0d8ed4b8f4f31730ce1e7e9 /t/io | |
parent | 04b15fa1d5c2253355e5fd5f1b6df30e135e71e5 (diff) | |
download | perl-130a7b3aa229167baeb66d349b459da7d43088ee.tar.gz |
which_perl for safer $^Xing
Message-ID: <20011207034544.GN22648@blackrider>
(plus op/ref tweak)
p4raw-id: //depot/perl@13506
Diffstat (limited to 't/io')
-rwxr-xr-x | t/io/open.t | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/t/io/open.t b/t/io/open.t index 92e71ea47a..cb8aea371f 100755 --- a/t/io/open.t +++ b/t/io/open.t @@ -12,6 +12,8 @@ $Is_VMS = $^O eq 'VMS'; plan tests => 95; +my $Perl = which_perl(); + { unlink("afile") if -f "afile"; @@ -76,7 +78,7 @@ SKIP: { skip "open -| busted and noisy on VMS", 3 if $Is_VMS; ok( open(my $f, '-|', <<EOC), 'open -|' ); - $^X -e "print qq(a row\n); print qq(another row\n)" + $Perl -e "print qq(a row\n); print qq(another row\n)" EOC my @rows = <$f>; @@ -86,7 +88,7 @@ EOC { ok( open(my $f, '|-', <<EOC), 'open |-' ); - $^X -pe "s/^not //" + $Perl -pe "s/^not //" EOC my @rows = <$f>; @@ -169,7 +171,7 @@ SKIP: { skip "open -| busted and noisy on VMS", 3 if $Is_VMS; ok( open(local $f, '-|', <<EOC), 'open local $f, "-|", ...' ); - $^X -e "print qq(a row\n); print qq(another row\n)" + $Perl -e "print qq(a row\n); print qq(another row\n)" EOC my @rows = <$f>; @@ -179,7 +181,7 @@ EOC { ok( open(local $f, '|-', <<EOC), 'open local $f, "|-", ...' ); - $^X -pe "s/^not //" + $Perl -pe "s/^not //" EOC my @rows = <$f>; @@ -203,13 +205,13 @@ like( $@, qr/Bad filehandle:\s+afile/, ' right error' ); { local *F; for (1..2) { - ok( open(F, qq{$^X -le "print 'ok'"|}), 'open to pipe' ); + ok( open(F, qq{$Perl -le "print 'ok'"|}), 'open to pipe' ); is(scalar <F>, "ok\n", ' readline'); ok( close F, ' close' ); } for (1..2) { - ok( open(F, "-|", qq{$^X -le "print 'ok'"}), 'open -|'); + ok( open(F, "-|", qq{$Perl -le "print 'ok'"}), 'open -|'); is( scalar <F>, "ok\n", ' readline'); ok( close F, ' close' ); } |