develooper Front page | perl.fwp | Postings from April 2002

Re: Self extracting Perl ARchive?

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
April 1, 2002 07:43
Subject:
Re: Self extracting Perl ARchive?
Message ID:
20020401154250.GE781@blackrider
On Mon, Apr 01, 2002 at 02:52:37PM +0100, Ian Phillipps wrote:
> There's a compression method that gives about 2:1 which is used by Psion
> text file readers. Very simple to decompress: my reader is attached, but
> it has "require 5.00557", so is somewhat ruled out.
> 
> require 5.00557;	# For unpack 'C/a'
> sub decomp {
>     my ($prefix,@dict[0..255],$rest)= unpack ( 'A9'.('C/a' x 256).'A*', $_[0] );
>     $rest =~ s/./$dict[ord $&]/sge;
>     return $rest;
>     }

Ooooh!  I like that.  2:1 compression is pretty good.  How does the
algorithm work?


> BTW, I'd be very much inclined not to use __DATA__, but to include each
> file as a perl '<<' literal.

Err... why?


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl Quality Assurance	    <perl-qa@perl.org>	       Kwalitee Is Job One
We don't know.	But if we did, we wouldn't tell you.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About