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 | Thread Next
From:
Zefram
Date:
July 2, 2017 10:24
Subject:
Re: How to check if a DateTime is invalid (again - but this timewithout using eval)?
Message ID:
20170702102421.GL7189@fysh.org
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.

-zefram

Thread Previous | Thread Next


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