[ABE.pm] making things more perlish

Ricardo SIGNES rjbs-perl-abe at lists.manxome.org
Sat Jan 8 04:46:13 PST 2005


* Jim Eshleman <jce0 at Lehigh.EDU> [2005-01-08T01:30:10]
> Long ago I decided to use Date::Calc for these kinds of things, so here 
> is how I would do it.  I know it doesn't really answer your question but 
> thought it may be of some use...

I'm with Jim.  DateTime is a goldarn pain in the butt.  It has a nice
interface, it works correctly, and it can do /anything/.  But it's huge,
and it can't be installed automatically on some platforms, and it's
often overkill for simple uses.

>         @ymd = $ymdstr =~ /(\d\d\d\d)(\d\d)(\d\d)/;

I would probably say:

  @ymd = $ymdstr =~ /\A(\d\d\d\d)(\d\d)(\d\d)\Z/;

to make sure that it's the only thing in the string... but that's just
me.  It's not a big deal.

-- 
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20050108/765dc00d/attachment.bin


More information about the ABE-pm mailing list