Skip to main content





use DDP; use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new( pattern => '%m/%d/%y %H:%M', time_zone => 'Europe/Rome', ); for my $date ( "3/25/06 2:44", "3/26/06 2:44" ) { my $dt = $strp->parse_datetime( $date ); p $dt; } 

submitted by /u/Perl_Version_42
[link] [comments]


I have code like this: my @f1 = ($from =~ m{/[^/]+}g); my @f2 = ($to =~ m{/[^/]+}g); Where ($from, $to) is also aviable as @_. How would I make this into one line, and so I don't have to copy pase the reuse expression. IIUC, map can only return a flat array, or arrayrefs, which you cannot initalise the values with.

submitted by /u/Both_Confidence_4147
[link] [comments]