Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: building a hash from regex matches

by NetWallah (Abbot)
on May 12, 2012 at 04:11 UTC ( #970130=note: print w/replies, xml ) Need Help??

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.

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

    Also as:

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://970130]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2016-10-23 02:20 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (300 votes). Check out past polls.