home *** CD-ROM | disk | FTP | other *** search
-
- print "1..5\n";
-
- #
- # test -a command line option
- #
-
- $x = `echo 1 2 3 4 5 | perl -nae 'print ((\$F[4] == 5) ? "ok": "not ok");'`;
-
- print $x, " 1\n";
-
- $tmp = "foo$$";
-
- #
- # test the -0 (record terminator) option
- #
-
- $x = `echo 1 2 3 4 | perl -0040 -l012 -ne 'print;'`;
- @x = $x ne '' ? split ('\n', $x) : ();
- if (@x == 4 && $x[0] eq "1") {print "ok 2\n";} else {print "not ok 2\n";}
-
- #
- # test the -w option
- #
- open (T, ">$tmp") || die "Can't open $tmp for writing: $!\n";
- print T 'print "$^W";';
- close T;
- $x = `perl -w $tmp`;
- unlink $tmp;
- if ($x eq "1") {print "ok 3\n";} else {print "not ok 3 ($x)\n";}
-
- open (T, ">$tmp") || die "Can't open $tmp for writing: $!\n";
- print T '$c = 1;';
- close T;
- $x = `perl -w $tmp 2>&1`;
- unlink $tmp;
- if ($x =~ /^Possible typo/) {print "ok 4\n";} else {print "not ok 4\n";}
-
- #
- # test the -l (line end processing) option
- #
-
- $x = `perl -l014 -e 'print "ok" if (\$\\ eq "\014");'`;
- chop $x;
- if ("$x" eq "ok") {print "ok 5\n";} else {print "not ok 5\n";}
-
-
- #
- # test the -s command line option
- #
-
-
-