home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!walter!porthos!donner!rdm2
- From: rdm2@donner.uucp (24337-mcburnett)
- Subject: Re: UUDECODE and perl ...
- Organization: Bellcore, Livingston, NJ
- Date: Wed, 11 Nov 92 13:41:19 GMT
- Message-ID: <1992Nov11.134119.15928@porthos.cc.bellcore.com>
- References: <1992Nov10.231657.17411@morwyn.uucp>
- Sender: netnews@porthos.cc.bellcore.com (USENET System Software)
- Lines: 45
-
- In article <1992Nov10.231657.17411@morwyn.uucp> forrie@morwyn.uucp (Forrest Aldrich) writes:
- >Someone was very kind and sent me a perl script which was supposed to
- >be able to 'cat' a file of combined uuencoded scripts, stripping all
- >the headers, etc., and placing them into one file to be decoded.
- >
- >I tried it, and it didn't work
- ...
- >Forrest
-
- Hi All,
-
- Here is what I use to "auto decode" articles. First I must ensure that
- the articles are in the proper order. (This could also be automated but
- I have never had the need.) Once the articles are in the proper order
- (in one file or in several) I can execute "extract" which will recognize
- the beginning of a uuencoded seciton and pass it to uudecode. My
- process uses the conventions that prevail in comp.binaries where a BEGIN
- code word preceeds the uuencoded stuff and an END follows it.
-
- -Roe
-
- Roe D McBurnett III Bellcore (908)699-2273 rdm2@chaucer.cc.bellcore.com
- #insert <std.disclamer>
-
- ================cut here================
- #! /usr/local/bin/perl -S
- #extract will scan for uuendcoded stuff and feed it to uudecode
- open(_uud,"|uudecode");
- line: while (<>) {
- if(/^BEGIN/){
- $p = 'y';
- next line;
- }
- if(/^END/){
- $p = 'n';
- }
- if( /^begin/ || /^end/ || /Subject/ ){
- print $_;
- }
- if($p eq 'y'){
- print _uud $_;
- }
- }
- Roe D McBurnett III Bellcore (908)699-2273 rdm2@chaucer.cc.bellcore.com
- #insert <std.disclamer>
-