home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5672 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.3 KB

  1. Path: sparky!uunet!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: how to 'write' cr-nl
  5. Message-ID: <1992Sep2.063834.2075@netlabs.com>
  6. Date: 2 Sep 92 06:38:34 GMT
  7. References: <399@carssdf.UUCP> <ASHERMAN.92Sep1091415@laser.fmrco.com> <400@carssdf.UUCP>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 37
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <400@carssdf.UUCP> watson@carssdf.UUCP (John Watson -- Self Empl. Sys.Integrator) writes:
  14. : In article <ASHERMAN.92Sep1091415@laser.fmrco.com> asherman@fmrco.COM writes:
  15. : >What's wrong with:
  16. : >
  17. : >format STDOUT =
  18. : >@<<<<<<<<<<<<<<<<<< Test: @>>>>>>>>>>>> ^M
  19. : >.
  20. : My problem here, besides forgeting to put it in on a line or two, and
  21. : creating a debugging mess is possibily
  22. : entering spaces after the ^M which are not visible by the vi editor,
  23. : creating leading white space on the next line.
  24.  
  25. It shouldn't do that, because formats drop any trailing spaces on the line.
  26.  
  27. Alternative 1.
  28.  
  29.     format STDOUT =
  30.     @<<<<<<<<<<<<<<<<<< Test: @>>>>>>>>>>>> @
  31.     $foo,                     $bar,        "\r"
  32.     .
  33.  
  34. Alternative 2.
  35.  
  36.     $child = open(STDOUT, "|-");
  37.     die "Phooey" unless defined $child;
  38.     if (!$child) {
  39.     $\ = "\r\n";
  40.     while (<STDIN>) {
  41.         chop;
  42.         print;
  43.     }
  44.     exit;
  45.     }
  46.  
  47. Larry
  48.