Hi Lars,
On Wed, 01 Jan 2014 12:38:17 +0200
Lars Noodén <[email protected]> wrote:
> Yes, happy new year 2014.
>
thanks!
> On 01/01/2014 12:09 PM, Shlomi Fish wrote:
>
> > 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).
>
> Thanks. So for that to work, I would wrap the calls to the offending
> subroutine in a subroutine of its own?
Or in an enclosing block. “local” does dynamic scoping so you can do something
like:
[CODE]
my $ret_value = do {
local $SIG{__WARN__} = sub {};
$obj->method(@ARGS);
};
[/CODE]
or a similar.
>
> > 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.
>
> It was also mentioned off list by someone else that the two offending
> lines in the module could be remmed out.
Yes.
>
> I'm really looking for a more portable solution, if there is one. Maybe
> there isn't and maybe I should try submitting a patch. Since the
> copyright notice in the module is 10 years old, where should a patch be
> sent?
According to https://metacpan.org/release/DateTime-Event-Sunrise , the module
in question had its latest release in 17 October 2013, which is not a long time
ago, so you can try submitting one to the Bugs link there and the maintainer
will get a notification. If possible, make sure you also add some
regression tests to the CPAN distribution’s test suite.
Regarding the copyright notice - I wouldn't rely on it too much, as many people
(including me) neglect to update it.
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/
A: I’m hungry today.
B: Well, wait until tomorrow. Maybe this feeling will pass.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/