[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg 1.1.1elf: many changes, more to come



Bruce Perens writes:
> 
> Pretty funny. Looks as if it was run through "tr 'aoyx' 'cu}W'" .

I *hate* gpm...

#!/usr/bin/perl
# uudecode.pl:  This should behave like your standard unix uudecode.
# usage uudecode < file or uudecode file.
# This code written by Carl Streeter, 1996.  This is in the public domain:
# if it breaks, you get to keep both pieces.
$infile = shift @ARGV;

if ($infile) {
	open (INFILE, "<$infile") || die "open in $infile: $!\n"; 
} else {
	open (INFILE, "<&STDIN") || die "dup stdin: $!\n";
}

while (($_ = <INFILE>) !~ /begin/) {}
$_ =~ /begin\s+\d+\s+(\S+)/;
$filename = $1;

open (OUTFILE, ">$filename") || die "open out $filename: $!\n";

while (($_ = <INFILE>) !~ /end/) {
	@tmp = unpack ("u",$_);
	foreach $i (@tmp) {print OUTFILE "$i";}
}


-- 
Carl Streeter                   |  "Etiquette-wise, there is no proper time 
streeter@cae.wisc.edu           |    to use the phrase 'It sucks.'" --Dogbert
Just another Perl hacker        |  "I'm a heartless bastard." --Linus Torvalds
Ask me about Debian/GNU Linux.  |    http://www.cae.wisc.edu/~streeter/



Reply to: