# compress open my $fh, ">:via(XXZ)", "test.xxz"; print $fh $text; # decompress open my $fh, "<:via(XXZ)", "test.xxz"; while (<$fh>) { ... }