Commit | Line | Data |
---|---|---|
8d063cd8 LW |
1 | #!./perl |
2 | ||
b5fe401b | 3 | BEGIN { |
a817e89d | 4 | chdir 't' if -d 't'; |
b5fe401b | 5 | @INC = '../lib'; |
c59238f2 | 6 | require './test.pl'; # for which_perl() etc |
58276457 | 7 | plan(3); |
b5fe401b MS |
8 | } |
9 | ||
c59238f2 | 10 | my $Perl = which_perl(); |
b5fe401b | 11 | |
2d90ac95 NC |
12 | my $filename = tempfile(); |
13 | ||
b5fe401b | 14 | $x = `$Perl -le "print 'ok';"`; |
8d063cd8 | 15 | |
58276457 | 16 | is($x, "ok\n", "Got expected 'perl -le' output"); |
8d063cd8 | 17 | |
2d90ac95 | 18 | open(try,">$filename") || (die "Can't open temp file."); |
8d063cd8 | 19 | print try 'print "ok\n";'; print try "\n"; |
d1e4d418 | 20 | close try or die "Could not close: $!"; |
8d063cd8 | 21 | |
2d90ac95 | 22 | $x = `$Perl $filename`; |
8d063cd8 | 23 | |
58276457 | 24 | is($x, "ok\n", "Got expected output of command from script"); |
8d063cd8 | 25 | |
2d90ac95 | 26 | $x = `$Perl <$filename`; |
8d063cd8 | 27 | |
58276457 | 28 | is($x, "ok\n", "Got expected output of command read from script"); |