No such thing as a small change | |
PerlMonks |
Re: Make Spreadsheet::ParseXLSX be quiet about errors ($SIG{__WARN__} )by LanX (Saint) |
on Aug 18, 2022 at 15:42 UTC ( [id://11146230]=note: print w/replies, xml ) | Need Help?? |
> How can I grab all erorrs to some variable without polluting stderr? eval {BLOCK} is only catching fatal errors, either thrown with die or from inside perl. But these seem to come from warn One way is to locally use a %SIG -handler. DEMO:
There is also a pragma for this redirection - use warnings FATAL =>"all"; ° But with a handler you can also choose to save the warnings to another variable separate from fatals. FWIW: Another approach would be to locally redirect STDERR to a var...
Cheers Rolf °) updated see https://perldoc.perl.org/warnings#Fatal-Warnings for more
In Section
Seekers of Perl Wisdom
|
|