home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / perl / 6994 < prev    next >
Encoding:
Text File  |  1992-11-16  |  2.5 KB  |  75 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!mcsun!sun4nl!spider.research.ptt.nl!athena.research.ptt.nl!sjaak
  3. From: sjaak@athena.research.ptt.nl (Sjaak Schilperoort)
  4. Subject: Re: UUDECODE and perl ...
  5. Message-ID: <sjaak.721911835@athena.research.ptt.nl>
  6. Originator: sjaak@athena.research.ptt.nl
  7. Sender: usenet@spider.research.ptt.nl (USEnet News)
  8. Nntp-Posting-Host: athena.research.ptt.nl
  9. Reply-To: J.W.Schilperoort@research.ptt.nl
  10. Organization: PTT Research
  11. References: <1992Nov10.231657.17411@morwyn.uucp>     <1992Nov11.134119.15928@porthos.cc.bellcore.com>     <1992Nov11.150851.10057@news.eng.convex.com> <MERLYN.92Nov11094326@romulus.reed.edu>
  12. Date: Mon, 16 Nov 1992 11:03:55 GMT
  13. Lines: 60
  14.  
  15. merlyn@ora.com (Randal L. Schwartz) writes:
  16.  
  17. >In fact, here's my program that uudecodes, ignoring anything that's
  18. >not a legal part of the uudecode.  I call it "uumerge".  There are
  19. >*many* broken uuencoders out there on the net, which is why it goes
  20. >through all these gyrations to figure out what the legal uu-lines are.
  21. >Ugh.
  22.  
  23. And here is my patch to Randal's program to allow unpacking more than
  24. one file at a time. Very handy when, say from nn, you pipe all parts of
  25. 10 binaries through uumerge (the parts have to be in the right order, but
  26. for me they usually are).
  27.  
  28.             Sjaak.
  29.  
  30. *** uumerge.orig    Mon Nov 16 12:02:40 1992
  31. --- uumerge    Mon Nov 16 12:01:09 1992
  32. ***************
  33. *** 4,14 ****
  34.   ## Written by Randal L. Schwartz, Stonehenge Consulting Services, Portland, OR
  35.   ## uudecodes the arguments (or stdin), ignoring non-uuencoded lines
  36.   
  37.   shift,$debug++ if $ARGV[0] =~ /^-d/; # show lines being skipped
  38.   while (<>) {
  39. !     last if ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
  40.   }
  41. ! die "missing begin" unless $_;
  42.   open(OUT,"> $file") if $file ne "";
  43.   while (<>) {
  44.       last if /^end/;
  45. --- 4,17 ----
  46.   ## Written by Randal L. Schwartz, Stonehenge Consulting Services, Portland, OR
  47.   ## uudecodes the arguments (or stdin), ignoring non-uuencoded lines
  48.   
  49. + again:
  50. + $sawbegin = 0;
  51.   shift,$debug++ if $ARGV[0] =~ /^-d/; # show lines being skipped
  52.   while (<>) {
  53. !     $sawbegin++, last if ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
  54.   }
  55. ! exit 0 unless $_;
  56. ! die "missing begin" unless $sawbegin;
  57.   open(OUT,"> $file") if $file ne "";
  58.   while (<>) {
  59.       last if /^end/;
  60. ***************
  61. *** 33,36 ****
  62.   }
  63.   die "missing end" unless $_;
  64.   chmod oct($mode), $file;
  65. ! exit 0;
  66. --- 36,39 ----
  67.   }
  68.   die "missing end" unless $_;
  69.   chmod oct($mode), $file;
  70. ! goto again;
  71.  
  72. -- 
  73. Sjaak Schilperoort                   J.W.Schilperoort@research.ptt.nl
  74. PTT Research, The Netherlands
  75.