Hi Lars,

Happy new year and I apologise for the late response.

Please reply to list - http://shlom.in/reply .

On Sat, 28 Dec 2013 20:05:12 +0200
Lars Noodén <lars.noo...@gmail.com> wrote:

> DateTime::Event::Sunrise carps to stderr during the polar day or night.
>  From the man page:
> 
>        'the module "carp"s that the sun never rises or never sets.'
> 
> How can that output to stderr be suppressed so that the module is quiet?
> 

If it's a warning you can do «local $SIG{__WARN__} = sub { ... }». See %SIG in
«perldoc perlvar» (see http://perldoc.perl.org/perlvar.html - it's also «perldoc
-v '%SIG'» in recent versions of the perldoc command).

If it's an exception, then you can use either «eval { ... }» or alternatively
«local $SIG{__DIE__}».

It’s also possible to override the STDERR file handle, but this is quite nasty.

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://shlom.in/hhfg

The NSA has a patent for an efficient process for collecting a lot of
information and doing nothing with it.
    — http://www.shlomifish.org/humour/bits/facts/NSA/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to