in reply to unzipping files with .gz extension
The .gz suffix implies a gzip compressed file. If you go to CPAN and search for gzip, you'll find several modules that will help solve your problem. I can't recommend which one to use, as I've not used any of them. Perhaps another monk will chime in with a recommendation.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom