Fellows
I was playing with pack() together with Compress::Zlib some time ago, so I could gen some compressed eval()-uable perl code for a programming toy.
While I think about the problem, I figured out that I need to represent the databytes generated from Compress::Zlib as a hexadecimal sequence of digits. I figured how to do this, but can't get the results back. Reading the manual, I wasn't able to determine what I'm doing The Wrong Way(tm). Below follows my code:
use Compress::Zlib; $code = q#print "Here I will put some nice code to be uncompressed and + eval()ed latter";#; $code = unpack 'H*', Compress::Zlib::memGzip( $code ); print pack 'H*', Compress::Zlib::memGunzip( $code ); # Here I get something very strange...
I'm almost sure that I'm doing something very stupid, but I can't see this now. Can anybody please point me a easy way to code this?
As a side-question, I would like to know your opinion about this: is this technique a good way to reduce the communications bandwidth needed to send Large Programs(tm) trought a highly used, low bandwidth serial communications channel between two machines? What you would do in my place?
Please note that this is just a sketch of an initial approach, not a complete solution for the problem.
UPDATE: No, this is not homework! It's just a toy for my low cost service serial point-to-point home-made network laboratory.
"In few words, translating PerlMonks documentation and best articles to other languages is like building a bridge to join other Perl communities into PerlMonks family. This makes the family bigger, the knowledge greather, the parties better and the life easier." -- monsieur_champs
In reply to reversible pack()? by monsieur_champs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |