home *** CD-ROM | disk | FTP | other *** search
/ Freelog 15 / FREELOG 15.ISO / WebMaster / Perl / PERL5106.ZIP / perl5 / ntt / Op / write.ntt < prev   
Encoding:
Text File  |  1995-11-07  |  2.6 KB  |  143 lines

  1. #Portions (c) 1995 Microsoft Corporation. All rights reserved.
  2. #        Developed by hip communications inc., http://info.hip.com/info/
  3.  
  4. #!./perl
  5.  
  6. # $RCSfile: write.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:38 $
  7.  
  8. print "1..3\n";
  9.  
  10. format OUT =
  11. the quick brown @<<
  12. $fox
  13. jumped
  14. @*
  15. $multiline
  16. ^<<<<<<<<<
  17. $foo
  18. ^<<<<<<<<<
  19. $foo
  20. ^<<<<<<...
  21. $foo
  22. now @<<the@>>>> for all@|||||men to come @<<<<
  23. {
  24.     'i' . 's', "time\n", $good, 'to'
  25. }
  26. .
  27.  
  28. open(OUT, '>Op_write.tmp') || die "Can't create Op_write.tmp";
  29.  
  30. $fox = 'foxiness';
  31. $good = 'good';
  32. $multiline = "forescore\nand\nseven years\n";
  33. $foo = 'when in the course of human events it becomes necessary';
  34. write(OUT);
  35. close OUT;
  36.  
  37. $right =
  38. "the quick brown fox
  39. jumped
  40. forescore
  41. and
  42. seven years
  43. when in
  44. the course
  45. of huma...
  46. now is the time for all good men to come to\n";
  47.  
  48. # WYT 1995-05-03 changed to cope with MS-DOS
  49. #if (`cat Op_write.tmp` eq $right)
  50. if (`type Op_write.tmp` eq $right)
  51.     { print "ok 1\n"; unlink 'Op_write.tmp'; }
  52. else
  53.     { print "not ok 1\n"; }
  54.  
  55. format OUT2 =
  56. the quick brown @<<
  57. $fox
  58. jumped
  59. @*
  60. $multiline
  61. ^<<<<<<<<< ~~
  62. $foo
  63. now @<<the@>>>> for all@|||||men to come @<<<<
  64. 'i' . 's', "time\n", $good, 'to'
  65. .
  66.  
  67. open OUT2, '>Op_write.tmp' or die "Can't create Op_write.tmp";
  68.  
  69. $fox = 'foxiness';
  70. $good = 'good';
  71. $multiline = "forescore\nand\nseven years\n";
  72. $foo = 'when in the course of human events it becomes necessary';
  73. write(OUT2);
  74. close OUT2;
  75.  
  76. $right =
  77. "the quick brown fox
  78. jumped
  79. forescore
  80. and
  81. seven years
  82. when in
  83. the course
  84. of human
  85. events it
  86. becomes
  87. necessary
  88. now is the time for all good men to come to\n";
  89.  
  90. # WYT 1995-05-03 changed to cope with MS-DOS
  91. #if (`cat Op_write.tmp` eq $right)
  92. if (`type Op_write.tmp` eq $right)
  93.     { print "ok 2\n"; unlink 'Op_write.tmp'; }
  94. else
  95.     { print "not ok 2\n"; }
  96.  
  97. eval <<'EOFORMAT';
  98. format OUT2 =
  99. the brown quick @<<
  100. $fox
  101. jumped
  102. @*
  103. $multiline
  104. and
  105. ^<<<<<<<<< ~~
  106. $foo
  107. now @<<the@>>>> for all@|||||men to come @<<<<
  108. 'i' . 's', "time\n", $good, 'to'
  109. .
  110. EOFORMAT
  111.  
  112. open(OUT2, '>Op_write.tmp') || die "Can't create Op_write.tmp";
  113.  
  114. $fox = 'foxiness';
  115. $good = 'good';
  116. $multiline = "forescore\nand\nseven years\n";
  117. $foo = 'when in the course of human events it becomes necessary';
  118. write(OUT2);
  119. close OUT2;
  120.  
  121. $right =
  122. "the brown quick fox
  123. jumped
  124. forescore
  125. and
  126. seven years
  127. and
  128. when in
  129. the course
  130. of human
  131. events it
  132. becomes
  133. necessary
  134. now is the time for all good men to come to\n";
  135.  
  136. # WYT 1995-05-03 changed to cope with MS-DOS
  137. #if (`cat Op_write.tmp` eq $right)
  138. if (`type Op_write.tmp` eq $right)
  139.     { print "ok 3\n"; unlink 'Op_write.tmp'; }
  140. else
  141.     { print "not ok 3\n"; }
  142.  
  143.