Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2017-02-26 12:39 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (372 votes). Check out past polls.