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

Re: Self extracting Perl ARchive?

Thread Previous | Thread Next
Michael G Schwern
April 1, 2002 07:43
Re: Self extracting Perl ARchive?
Message ID:
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   <>
Perl Quality Assurance	    <>	       Kwalitee Is Job One
We don't know.	But if we did, we wouldn't tell you.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About