in reply to Keeping deflated data in memory

From the documentation:

A scalar reference

If $output_filename_or_reference is a scalar reference, the compressed data will be stored in $$output_filename_or_reference.
Premature optimization is the root of all job security