home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5289 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!swrinde!mips!odin!fido!fido!rickb
  2. From: rickb@farfle.farfle.asd.sgi.com (Rick Braumoeller)
  3. Newsgroups: comp.lang.perl
  4. Subject: write/format bug
  5. Message-ID: <RICKB.92Aug12173851@farfle.farfle.asd.sgi.com>
  6. Date: 13 Aug 92 01:38:51 GMT
  7. Sender: news@fido.asd.sgi.com (Usenet News Admin)
  8. Distribution: comp
  9. Organization: Silicon Graphics, Inc.
  10. Lines: 40
  11.  
  12. A Perl script that I use goes into several directories and
  13. collects information about the files in them.  It then summarizes
  14. using "write".  Sometimes the information can be multi-lined,
  15. so I'd like to get output like this:
  16.  
  17. Directory  |  Comments
  18. -----------+----------------------------------
  19. dir1       |  This and that
  20. foo        |  A longer comment, that spans two
  21.            |  lines
  22.  
  23. For this, I am using the following format:
  24.  
  25. format STDOUT =
  26. @<<<<<<<<< |  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  27. $dir,         $results{$dir}
  28. ~~         |  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  29.               $results{$dir}
  30. .
  31.  
  32. However, when I run with this format, Perl goes into some kind
  33. of infinite loop when I do the first 'write' - slowly
  34. consuming memory.  If I get rid of the | from the continuation
  35. line, like this,
  36.  
  37. format STDOUT =
  38. @<<<<<<<<< |  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  39. $dir,         $results{$dir}
  40. ~~            ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  41.               $results{$dir}
  42. .
  43.  
  44. everything works fine, but my output isn't as nice.
  45.  
  46. Have I stumbled on something?  If you can't reproduce this
  47. behavior, I'll gladly forward my script to you.
  48.  
  49. Insight greatly appreciated... 
  50.  
  51. (BTW, using Patch level: 35)
  52.