http://www.perlmonks.org?node_id=1012663


in reply to Redirecting location in perl

Have you tried including the path in the gunzip command, like this?
gunzip "c:/somepath/$input" => "d:/anotherpath/$output"