home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!mcsun!sun4nl!spider.research.ptt.nl!athena.research.ptt.nl!sjaak
- From: sjaak@athena.research.ptt.nl (Sjaak Schilperoort)
- Subject: Re: UUDECODE and perl ...
- Message-ID: <sjaak.721911835@athena.research.ptt.nl>
- Originator: sjaak@athena.research.ptt.nl
- Sender: usenet@spider.research.ptt.nl (USEnet News)
- Nntp-Posting-Host: athena.research.ptt.nl
- Reply-To: J.W.Schilperoort@research.ptt.nl
- Organization: PTT Research
- 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>
- Date: Mon, 16 Nov 1992 11:03:55 GMT
- Lines: 60
-
- 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
-