in reply to IO::Compress::Gzip blank output
The docs clearly state that parameters can not be bare scalars (unless they are file paths, which is not the case for you). Try this:
Also, you're doing the file slurp in a wrong and slow way:use IO::Compress::Gzip qw(gzip $GzipError) # other code... IO::Compress::Gzip::gzip(\$content, \$newContent) or die "gzip failed: + $GzipError\n"
It is possible to write this as:my @transferFileContents = <FILE_TO_TRANSFER>; foreach(@transferFileContents) { $content .= $_; }
which means:$content = do { local $/; my $rv = <FILE_TO_TRANSFER>; $rv };
$content = do { # minimize scope local $/; # make input separator undef 'till the end of this scope my $rv = <FILE_TO_TRANSFER>; # get all contents $rv # return it };
In Section
Seekers of Perl Wisdom