use DateTime; my ($epoch1, $epoch2) = (split ' ', $line)[17,18]; my $date1 = DateTime->from_epoch( epoch => $epoch1 ); ...