in reply to Coolest way to decode YYYYMMDD?
Not sure what you consider cool. Here's my balance between terse and obvious:
/(....)(..)(..)/; $dt = DateTime->new( year => $1, month => $2, day => $3 );
I suppose one could try to get a little clever by doing something like
my %th; @th{qw( year month day )} = /(....)(..)(..)/; $dt = DateTime->new( %th );
I don't know if that's any "cooler", though.
|
|---|