home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!news!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Newsgroups: comp.lang.perl
- Subject: Re: how to 'write' cr-nl
- Message-ID: <1992Sep2.063834.2075@netlabs.com>
- Date: 2 Sep 92 06:38:34 GMT
- References: <399@carssdf.UUCP> <ASHERMAN.92Sep1091415@laser.fmrco.com> <400@carssdf.UUCP>
- Sender: news@netlabs.com
- Organization: NetLabs, Inc.
- Lines: 37
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <400@carssdf.UUCP> watson@carssdf.UUCP (John Watson -- Self Empl. Sys.Integrator) writes:
- : In article <ASHERMAN.92Sep1091415@laser.fmrco.com> asherman@fmrco.COM writes:
- : >What's wrong with:
- : >
- : >format STDOUT =
- : >@<<<<<<<<<<<<<<<<<< Test: @>>>>>>>>>>>> ^M
- : >.
- :
- : My problem here, besides forgeting to put it in on a line or two, and
- : creating a debugging mess is possibily
- :
- : entering spaces after the ^M which are not visible by the vi editor,
- : creating leading white space on the next line.
-
- It shouldn't do that, because formats drop any trailing spaces on the line.
-
- Alternative 1.
-
- format STDOUT =
- @<<<<<<<<<<<<<<<<<< Test: @>>>>>>>>>>>> @
- $foo, $bar, "\r"
- .
-
- Alternative 2.
-
- $child = open(STDOUT, "|-");
- die "Phooey" unless defined $child;
- if (!$child) {
- $\ = "\r\n";
- while (<STDIN>) {
- chop;
- print;
- }
- exit;
- }
-
- Larry
-