Re: How to check if a DateTime is invalid (again - but this time without using eval)?

[email protected] (Dave Rolsky) Wed, 5 Jul 2017 12:53:59 -0500
Newsgroups perl.datetime
Message-ID <CAHKw1MJsM7s8_hiWjj-HGn2nopDLHokOSEOtx-T=Lhj8+EXGaw@mail.gmail.com>
On Wed, Jul 5, 2017 at 12:49 PM, Eric Brine <[email protected]> wrote:

> On Wed, Jul 5, 2017 at 12:43 PM, Dave Rolsky <[email protected]> wrote:
>
>> On Wed, Jul 5, 2017 at 11:27 AM, Bill Moseley <[email protected]> wrote:
>>
>>> Haven't those issues with eval been addressed in more recent versions of
>>> Perl?  Well, that's one issue, but there are others, for example $@ being
>>> set to a false value.
>>>
>>
> That's kinda hard to do by accident.
>
>

Assuming you are in full control of all the relevant code, yes, I suppose
it is. That said, a little extra defensive programming usually seems like
the best choice to me. What is gained by discouraging people from using
CPAN modules that help avoid corner cases?


Cheers,

Dave Rolsky
http://blog.urth.org
https://github.com/autarch