home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!umn.edu!cybrspc!roy
- From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail)
- Newsgroups: comp.lang.perl
- Subject: Re: UUDECODE and perl ...
- Message-ID: <63H6TB1w165w@cybrspc.UUCP>
- Date: Thu, 12 Nov 92 18:05:04 CST
- References: <1992Nov11.134119.15928@porthos.cc.bellcore.com>
- Organization: Villa CyberSpace, Minneapolis, MN
- Lines: 30
-
- rdm2@donner.uucp (24337-mcburnett) writes:
-
- > Hi All,
- >
- > Here is what I use to "auto decode" articles.
- [...]
- >
- > ================cut here================
- > #! /usr/local/bin/perl -S
- > #extract will scan for uuendcoded stuff and feed it to uudecode
- > open(_uud,"|uudecode");
-
- But why? That's built in....
-
- | #!/usr/bin/perl
- | $_ = <> until ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
- | open(OUT,"> $file") if $file ne "";
- | while (<>) {
- | last if /^end/;
- | next if /[a-z]/;
- | next unless int((((ord() - 32) & 077) + 2) / 3) == int(length() / 4);
- | print OUT unpack("u", $_);
- | }
- | chmod oct($mode), $file;
-
- (uudecode.pl courtesy of Randal Schwartz)
- --
- Roy M. Silvernail -- roy%cybrspc@cs.umn.edu - OR- cybrspc!roy@cs.umn.edu
- "I'm a model citizen."
- -- Warren Zevon
-