CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Searching two-value hash array: Edit Log



CPS
Novice

Sep 14, 2012, 5:31 AM


Views: 2419
Searching two-value hash array

Hi,

I would like to compare two values in the one hash key.
To be more clear let's assume this situation:


Code
HASH KEY              |-VALUE-|  
(a) (b)
250 50 4 <- PAIR 1
50 250 5 <- PAIR 1
47 250 1 <- PAIR 2
101 250 7 <- PAIR 3
250 47 8 <- PAIR 2
250 101 9 <- PAIR 3



And i Would like to get following output:

KEYS | a value | b value | total
250 50 | 4 | 5 | 9
47 250 | 1 | 8 | 9
101 250 | 7 | 9 | 16


How i could do that?


(This post was edited by CPS on Sep 14, 2012, 5:33 AM)


Edit Log:
Post edited by CPS (Novice) on Sep 14, 2012, 5:33 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives