in reply to gunzip exception
Maybe check if $gz is an empty string and don't try to call gunzip() in that case?
I also can't reproduce your problem. eval catches the error message correctly for me with your code (amended below to show that):
use 5.012; use warnings; use Gzip::Faster; my $gz=""; my $data; eval {$data=gunzip($gz)}; if($@) { say qq(error: $@) }; say "Done"
This gives me the output:
Attempt to uncompress empty string at ... Done
Most likely the code you post is not the code you run.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: gunzip exception
by luxs (Beadle) on Feb 08, 2021 at 10:38 UTC |