in reply to Storing large data structures on disk

It might be worth mentioning that once on disk, the binary file cab be highly compressed (~1:100), but I was not able to figure out if I can use this nice property
Print to a pipe that does the compression? For instance:
open my $fh, "| gzip -9 > file.gz" or die $!;