Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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.
                   -SNL


Comment on Re: building a hash from regex matches
Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2014-07-29 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls