in reply to building a hash from regex matches

Not any more efficient, but can be written as a single line:
my %data2= map {/^(\w+).*?sum\s+([0-9.]+)/} @lines;

             I hope life isn't a big joke, because I don't get it.
                   -SNL

Replies are listed 'Best First'.
Re^2: building a hash from regex matches
by jwkrahn (Abbot) on May 12, 2012 at 05:43 UTC

    Also as:

    my %data2 = "@lines" =~ /^(\w+).*?sum\s+([0-9.]+)/mg;