in reply to Re^2: split snafus
in thread split snafus

It should be more readable to do it like this:

my %hFields; while ( $line =~ / \( (\d+) \* ([^)]+) \) /gx ) { $hFields{ $2 } += $1; }

Replies are listed 'Best First'.
Re^4: split snafus
by manav_gupta (Acolyte) on Jun 05, 2009 at 14:49 UTC
    d'oh! Yeah, it all makes sense now ...