This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/harness can run the tests lib/*.t in parallel with each other.
[perl5.git] / t / run / switchF1.t
CommitLineData
48c4c863
NC
1#!perl -w
2print "1..5\n";
3
2d90ac95 4my $file = "Run_switchF1.pl";
48c4c863
NC
5
6open F, ">$file" or die "Open $file: $!";
7
8my $prog = <<'EOT';
9#!./perl -anF[~#QQ\\xq']
10
11BEGIN {
12 *ARGV = *DATA;
13}
14print "@F";
15
16__DATA__
17okx1
18okq2
19ok\3
20ok'4
21EOT
22
23# 2 of the characters toke.c used to use to quote the split parameter:
24$prog =~ s/QQ/\x01\x80/;
25# These 2 plus ~ # and ' were enough to make perl choke
26print F $prog;
27close F or die "Close $file: $!";
28
29print system ($^X, $file) ? "not ok 5\n" : "ok 5\n";
30
31unlink $file or die "Unlink $file: $!";