sub get_date { my $string = shift; my $date = (split ' ', $string)[1]; # second field return $date;