format OUT = the quick brown @<< $fox jumped @* $multiline ^<<<<<<<<< $foo ^<<<<<<<<< $foo ^<<<<<<... $foo now @<>>> for all@|||||men to come @<<<< { 'i' . 's', "time\n", $good, 'to' } . open(OUT, '>Op_write.tmp') || die "Can't create Op_write.tmp"; END { 1 while unlink 'Op_write.tmp' }$good = 'good'; $multiline = "forescore\nand\nseven years\n"; $foo = 'when in the course of human events it becomes necessary'; write(OUT); close OUT or die "Could not close: $!"; $right = "the quick brown fox jumped forescore and seven years when in the course of huma... now is the time for all good men to come to\n"; if (cat('Op_write.tmp') eq $right) { print "ok 1\n"; 1 while unlink 'Op_write.tmp'; } else { print "not ok 1\n"; }