develooper Front page | perl.datetime | Postings from July 2017

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

Thread Previous
From:
Binarus
Date:
July 3, 2017 07:02
Subject:
Re: How to check if a DateTime is invalid (again - but this timewithout using eval)?
Message ID:
5097c833-2a76-84e1-2aa7-7fa9f319acd9@binarus.de
On 02.07.2017 12:24, Zefram wrote:
> Binarus wrote:
>> - Most people recommend to "catch the error" DateTime throws when
>> encountering such date-times, but if I got it right, that always
>> involves eval, even when using modules like Try:Tiny and the like, so I
>> don't want to do that.
> 
> Do this.  eval is the right tool for the job.
> 

Thank you very much for your answer. I have decided to follow your
advice. I will use an eval block where I try to construct the date-time,
and will probably add a local DIE handler in there (although I have no
other DIE handlers installed anywhere, so I am still thinking about it).

Regards,

Binarus

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About