I realized how I should rephrase my question to be more specific...
Let's say I have the string $result with "Hi, I'm a result." in it.
How do I get Compress::Zlib to take $result in, compress it, and output it not to a file, but to another variable string, say $resultcompressed ? This is what my problem is with understanding Compress::Zlib. If this doesn't work, what other path's do I have to choose from other than taking the output of the file and sending that as a whole chunk?