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

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://970130]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-10-18 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (249 votes). Check out past polls.

    Notices?