in reply to compressing text

Bzip2 compresses more than gzip. You can use the Compress::Bzip2 module on scalars.