This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate tryAMAGICunW() by refactoring tryAMAGICun{DEREF,TARGET}
[perl5.git] / t / run / script.t
1 #!./perl
2
3 BEGIN {
4     chdir 't';
5     @INC = '../lib';
6     require './test.pl';        # for which_perl() etc
7 }
8
9 my $Perl = which_perl();
10
11 my $filename = tempfile();
12
13 print "1..3\n";
14
15 $x = `$Perl -le "print 'ok';"`;
16
17 if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";}
18
19 open(try,">$filename") || (die "Can't open temp file.");
20 print try 'print "ok\n";'; print try "\n";
21 close try or die "Could not close: $!";
22
23 $x = `$Perl $filename`;
24
25 if ($x eq "ok\n") {print "ok 2\n";} else {print "not ok 2\n";}
26
27 $x = `$Perl <$filename`;
28
29 if ($x eq "ok\n") {print "ok 3\n";} else {print "not ok 3\n";}