summaryrefslogtreecommitdiff
path: root/t/run/switchF1.t
blob: fc59645646f1b142d25ade87d988b372c6b96cd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!perl -w
print "1..5\n";

my $file = "F-Pathological.pl";

open F, ">$file" or die "Open $file: $!";

my $prog = <<'EOT';
#!./perl -anF[~#QQ\\xq']

BEGIN {
    *ARGV = *DATA;
}
print "@F";

__DATA__
okx1
okq2
ok\3
ok'4
EOT

# 2 of the characters toke.c used to use to quote the split parameter:
$prog =~ s/QQ/\x01\x80/;
# These 2 plus ~ # and ' were enough to make perl choke
print F $prog;
close F or die "Close $file: $!";

print system ($^X, $file) ? "not ok 5\n" : "ok 5\n";

unlink $file or die "Unlink $file: $!";