my ($dt,$mon,$yr,$hr,$min,$sec,$restofit) = split(\d+?/\d+?/\d+?\s+\d+?\:\d+?[\w?¦\s?],$line);
where
\d+?/\d+?/\d+? is date,month & year
\s+ is space
\d+?\:\d+? is hh:mi
[\w?¦\s?] is word or spaces, i.e. the rest of the string.
Can somebody show me what the split command should be?
If you're only interested in the numbers, you could use:
($dt,$mon,$yr,$hr,$min,$sec) = split /\D+/, $line;
This splits the line on 'one or more non-digits', giving a list of all numbers.
The other way would be:
($dt,$mon,$yr,$hr,$min,$sec) = $line =~ m/(\d+)/g
The g modifier applies the regex 'one or more digits' to $line globally, and returns an array of all matches.