3 # $RCSfile: write.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:38 $
7 my $CAT = ($^O eq 'MSWin32') ? 'type' : 'cat';
21 now @<<the@>>>> for all@|||||men to come @<<<<
23 'i' . 's', "time\n", $good, 'to'
27 open(OUT, '>Op_write.tmp') || die "Can't create Op_write.tmp";
31 $multiline = "forescore\nand\nseven years\n";
32 $foo = 'when in the course of human events it becomes necessary';
45 now is the time for all good men to come to\n";
47 if (`$CAT Op_write.tmp` eq $right)
48 { print "ok 1\n"; unlink 'Op_write.tmp'; }
50 { print "not ok 1\n"; }
53 my $fox = 'foxiness'; # Test a lexical variable.
63 now @<<the@>>>> for all@|||||men to come @<<<<
64 'i' . 's', "time\n", $good, 'to'
67 open OUT2, '>Op_write.tmp' or die "Can't create Op_write.tmp";
70 $multiline = "forescore\nand\nseven years\n";
71 $foo = 'when in the course of human events it becomes necessary';
87 now is the time for all good men to come to\n";
89 if (`$CAT Op_write.tmp` eq $right)
90 { print "ok 2\n"; unlink 'Op_write.tmp'; }
92 { print "not ok 2\n"; }
104 now @<<the@>>>> for all@|||||men to come @<<<<
105 'i' . 's', "time\n", $good, 'to'
109 open(OUT2, '>Op_write.tmp') || die "Can't create Op_write.tmp";
113 $multiline = "forescore\nand\nseven years\n";
114 $foo = 'when in the course of human events it becomes necessary';
131 now is the time for all good men to come to\n";
133 if (`$CAT Op_write.tmp` eq $right)
134 { print "ok 3\n"; unlink 'Op_write.tmp'; }
136 { print "not ok 3\n"; }
158 my $format1 = '@' . '>' x $_;
159 formline $format1, 'abc';
160 $was1 .= "$format1 $^A\n";
163 local $format2 = '@' . '>' x $_;
164 formline $format2, 'abc';
165 $was2 .= "$format2 $^A\n";
167 print $was1 eq $mustbe ? "ok 4\n" : "not ok 4\n";
168 print $was2 eq $mustbe ? "ok 5\n" : "not ok 5\n";