in reply to Parsing a data field that is seperated by data/time entries

Given that the data source is a big text field from a database table, I wouldn't count on newlines as being a reliable guide for separating the entries. Better to use a capturing split with a regex that will match the date string -- especially if you know what "username" has to look like (e.g. all alphnumerics, between 2 and 8 characters, always starting with a letter, or whatever).
my $datex = qr/\[ # match open square bracket [FMSTW][a-u]{2} \s # match day of week [ADFJMNOS][a-y]{2} \s+ # match month \d+ \s+ \d+:\d{2}:\d{2} \s \d{4} , \s+ # match date +, time, year \w+ # match username (could be more explicit) \]:/x; # match closing bracket, colon my @text_blocks = split /($datex)/, $textfield; my $initial_junk = shift @text_blocks unless ( $text_blocks[0] =~ /$da +tex/ ); my %entry = ( @text_blocks ); print "DATE=> $_ STRING=> $entry{$_}\n" for (keys %entry);
(update: simplified the part that matches the time field)