>>>>> "BH" == Bryan Harris <bryansli...@gmail.com> writes:

  BH> I have about 60 MB of text data I want to include at the bottom of
  BH> a script.

  BH> 60 MB is too big for us, but compressed it would be probably only
  BH> 3-6 MB which is much better.  Is there any way to put gzipped data
  BH> in the DATA section of a script, and conveniently read it?

  BH> I'd also prefer that my script be able to survive getting passed
  BH> through a terminal -- is it hard to encode the data block (MIME
  BH> perhaps?) so it will?

not details but a couple of suggestions. there are several compress
modules in cpan and i would guess some can take a string arg. if they
can't you can still open a string (see perldoc perlopentut) as a file
handle. so that solves the uncompress part. you can store the data
encoded with B64 in the DATA part of a module/script (after __DATA__) or
in a here doc. get it and decode it with a B64 or some other decoder (i
think unpack/pack as uuencode support too). then uncompress. this should
be all of about 3-5 lines of code in total.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to