Currently I am using:
exec(\"zcat $filename\", $output)
To uncompress a .Z type file but unfortunately my hosting company has
.Z
system($shell_command, $response_var);
So in your case:
system("zcat $filename", $output);