in reply to complex regex

Here's one approach...

Instead of using a regex within the m// operator, this uses a regex within a split function. Whatever approach you take, the regular expression involved needn't be terribly complex.

my %counter; while ( <DATA> ) { my ( $name, $number ) = ( split /\s+/ )[0,2]; $counter{$name} += $number; } print "$_: $counter{$_}\n" foreach keys %counter; __DATA__ Jack Monday 4 Eddie Tuesday 6 Jack Friday 7

Dave