Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re^2: Make Spreadsheet::ParseXLSX be quiet about errors ($SIG{__WARN__} )
in thread Make Spreadsheet::ParseXLSX be quiet about errors

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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

UPDATE

well, 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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11146237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-03-28 10:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found