From ora.com!spdcc!think.com!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!haven.umd.edu!uunet!mcsun!sun4nl!spider.research.ptt.nl!athena.research.ptt.nl!sjaak Mon Nov 16 06:03:55 1992
Path: minya!ora.com!spdcc!think.com!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!haven.umd.edu!uunet!mcsun!sun4nl!spider.research.ptt.nl!athena.research.ptt.nl!sjaak
From: sjaak@athena.research.ptt.nl (Sjaak Schilperoort)
Newsgroups: comp.lang.perl
Subject: Re: UUDECODE and perl ...
Message-ID: <sjaak.721911835@athena.research.ptt.nl>
Date: 16 Nov 92 11:03:55 GMT
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>
Sender: usenet@spider.research.ptt.nl (USEnet News)
Reply-To: J.W.Schilperoort@research.ptt.nl
Organization: PTT Research
Lines: 60
Originator: sjaak@athena.research.ptt.nl
Nntp-Posting-Host: athena.research.ptt.nl

merlyn@ora.com (Randal L. Schwartz) writes:

>In fact, here's my program that uudecodes, ignoring anything that's
>not a legal part of the uudecode.  I call it "uumerge".  There are
>*many* broken uuencoders out there on the net, which is why it goes
>through all these gyrations to figure out what the legal uu-lines are.
>Ugh.

And here is my patch to Randal's program to allow unpacking more than
one file at a time. Very handy when, say from nn, you pipe all parts of
10 binaries through uumerge (the parts have to be in the right order, but
for me they usually are).

			Sjaak.

*** uumerge.orig	Mon Nov 16 12:02:40 1992
--- uumerge	Mon Nov 16 12:01:09 1992
***************
*** 4,14 ****
  ## Written by Randal L. Schwartz, Stonehenge Consulting Services, Portland, OR
  ## uudecodes the arguments (or stdin), ignoring non-uuencoded lines
  
  shift,$debug++ if $ARGV[0] =~ /^-d/; # show lines being skipped
  while (<>) {
! 	last if ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
  }
! die "missing begin" unless $_;
  open(OUT,"> $file") if $file ne "";
  while (<>) {
  	last if /^end/;
--- 4,17 ----
  ## Written by Randal L. Schwartz, Stonehenge Consulting Services, Portland, OR
  ## uudecodes the arguments (or stdin), ignoring non-uuencoded lines
  
+ again:
+ $sawbegin = 0;
  shift,$debug++ if $ARGV[0] =~ /^-d/; # show lines being skipped
  while (<>) {
! 	$sawbegin++, last if ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
  }
! exit 0 unless $_;
! die "missing begin" unless $sawbegin;
  open(OUT,"> $file") if $file ne "";
  while (<>) {
  	last if /^end/;
***************
*** 33,36 ****
  }
  die "missing end" unless $_;
  chmod oct($mode), $file;
! exit 0;
--- 36,39 ----
  }
  die "missing end" unless $_;
  chmod oct($mode), $file;
! goto again;

-- 
Sjaak Schilperoort                   J.W.Schilperoort@research.ptt.nl
PTT Research, The Netherlands


