Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Increasing key/values held in a Hash from an Array

by ikegami (Patriarch)
on Mar 17, 2006 at 21:21 UTC ( [id://537584]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @data = (
       [ 12, 'First line of text'  ],
    ...
          $_[0] += $y while $_[1] =~ /$re/g;
       }
    }
    
  2. or download this
    my @data = (
       [ 1, 12, 'First line of text'  ],
    ...
    
    print("Line ${$_}[0] has a score of ${$_}[1]\n")
       foreach sort { $b->[1] <=> $a->[1] } @data;
    
  3. or download this
    my @data = (
       [ 12, 'First line of text'  ],
    ...
    
    print("${$_}[0]: ${$_}[1]\n")
       foreach sort { $b->[0] <=> $a->[0] } @data;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found