http://www.perlmonks.org?node_id=1036676


in reply to Re: Coolest way to decode YYYYMMDD?
in thread Coolest way to decode YYYYMMDD?

You can disable a prototype rather than bending over backwards to comply to it.

use DateTime qw( ); use List::MoreUtils qw( mesh ); my $string = "19830501"; my $date = DateTime->new(&mesh( [qw( year month day )] => [ unpack "A4A2A2", $string ] ));