I wanted to uncompress multiple log.gz - files from yesterday.
use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ;
my ($sec, $min, $hour, $mday, $mon, $year) = (gmtime())[0..5];
my $yesterday_midday=timelocal($sec,$min,$hour,$mday,$mon,$year) - 24*60*60;
($sec, $min, $hour, $mday, $mon, $year) = localtime($yesterday_midday);
my $path = sprintf "..\\..\\history\\%d\\%02d\\%02d\\*.log.gz",$year+1900, $mon+1, $mday;
gunzip '<path>' => '<#1.log>' #unzip all .log.gz files
or die "gunzip failed: $GunzipError\n";
Max wild is #0, you tried #1 at D:/Perl64/lib/IO/Uncompress/Base.pm line 545
You need to expand the scalar
$path. In your case, you are telling gunzip to unzip a file named
path into wild carded output. The error tells you that the string "path" does not contain any wild cards, yet you are referring to the matching wild card (which does not exist since there were no wild cards in "path" string).
gunzip "<$path>" => '<#1.log>' #unzip all .log.gz files or die "gunzip failed: $GunzipError\n";