in reply to zipped and tar files.

I would recommend combining a few CPAN modules to get the desired result. Start out with File::Type to determine the file type.
my $ft = File::Type->new(); my $file_type = $ft->checktype_filename($file);
Or alternatively, you can check out Archive::TarGzip and mix that with the use of Archive::Zip based on the output of File::Type.