sub parse_format{ my $line = shift; my ($date, $number,); ## for returning while ($line =~ m/^ #linestart (\d+\/\d+\/\d+\s+\d+) # capture date and first number \,\s+ #junk in the middle (\d+) # capture the last bit $ # end of string /ox ) { ($date,$number,) = ($1, $2,); } else { warn "\'$line\' did not conform to format. Skipping...\n"; } return ($date, $number,); }