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: write/format bug
- Message-ID: <1992Aug14.001147.17639@netlabs.com>
- Date: 14 Aug 92 00:11:47 GMT
- References: <RICKB.92Aug12173851@farfle.farfle.asd.sgi.com>
- Sender: news@netlabs.com
- Distribution: comp
- Organization: NetLabs, Inc.
- Lines: 46
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <RICKB.92Aug12173851@farfle.farfle.asd.sgi.com> rickb@farfle.farfle.asd.sgi.com (Rick Braumoeller) writes:
- : A Perl script that I use goes into several directories and
- : collects information about the files in them. It then summarizes
- : using "write". Sometimes the information can be multi-lined,
- : so I'd like to get output like this:
- :
- : Directory | Comments
- : -----------+----------------------------------
- : dir1 | This and that
- : foo | A longer comment, that spans two
- : | lines
- :
- : For this, I am using the following format:
- :
- : format STDOUT =
- : @<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- : $dir, $results{$dir}
- : ~~ | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- : $results{$dir}
- : .
- :
- : However, when I run with this format, Perl goes into some kind
- : of infinite loop when I do the first 'write' - slowly
- : consuming memory. If I get rid of the | from the continuation
- : line, like this,
- :
- : format STDOUT =
- : @<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- : $dir, $results{$dir}
- : ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- : $results{$dir}
- : .
- :
- : everything works fine, but my output isn't as nice.
- :
- : Have I stumbled on something? If you can't reproduce this
- : behavior, I'll gladly forward my script to you.
-
- The current implementation detects blank lines by checking to see
- if the line is blank after inserting all the fields. In Perl 5
- this will be revised so that a line is considered blank if none
- of its @ or ^ fields interpolated anything (expect whitespace).
- If I manage to put out another patch for version 4 it'll include
- that change.
-
- Larry
-