mohan123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am supposed to get a compressed xml string from a server by LWP.
Now i want to decompress it using the Compress::Zlib module.
For doing a simple test i tried to first compress a big string and then decompressing it using this i found on the cpan documentation page for the module.
use Compress::Zlib; my $str_to_compress='a big string'; $compressed_str=compress($str_to_compress[,1]); #original syntax on cpan for the two functions #$dest = compress($source [, $level] ) ; #$dest = uncompress($source) ; $decompressed_str=uncompress($compressed_str); print $decompressed_str;
but when i try to run it it says wrong syntax.
please tell me the correct syntax or any other method to do it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: decompressing the string
by Joost (Canon) on Jun 24, 2006 at 13:29 UTC |