Keep It Simple, Stupid | |
PerlMonks |
Re^3: Make Spreadsheet::ParseXLSX be quiet about errors ( STDERR redirection ) (UPDATED)by LanX (Saint) |
on Aug 18, 2022 at 19:31 UTC ( [id://11146237]=note: print w/replies, xml ) | Need Help?? |
Yeah, but why? Redirecting STDERR is a tricky thing, there are long perldocs on this issue, and I'm not too confident about portability here. And you loose the ability to just selectively silence known warnings, while still being alarmed by unknown issues. So you will need to parse that variable afterwards. If you really want to capture all errors indiscriminately, better use warnings FATAL => 'all' inside eval (hence only for that lexical scope)
Cheers Rolf
UPDATEwell, ok. One advantage of redirecting STDERR is that print STDERR will also be caught. But the errors you've shown most certainly come from some Carp routines. (FWIW you might alsow want to look into Carp for silencing advice)
In Section
Seekers of Perl Wisdom
|
|