vsurend has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perl Monks, I am getting some values from database by querying. This data contains, 4 fields namely, Application Name, Date, Location, Average Response Time. This four fields will have multiple records.
Sample Data :
Application Name -Date -Location -AverageResponseTime
SMS3 -01/01/2012 -San Jose -2.24
SMS3 -01/02/2012 -San Jose -2.31
SMS3 -01/03/2012 -San Jose -2.43
SMS3 -01/01/2012 -New York -2.25
SMS3 -01/02/2012 -New York -2.13
SMS3 -01/03/2012 -New York -2.91
In iterations till the records are over I am getting one row of data into and array.
while ( my @row = $sth->fetchrow_array( )I want to get this array into hash map and then convert the fields like, Date, San Jose,New York ,... and its corresponding average response times as other rows
Data should become in format like :
Date -San Jose -New York
01/01/2012 -2.24 -2.25
01/02/2012 -2.31 -2.13
01/03/2012 -2.43 -2.91
Can you please help me to use hashmap for this
Thanks, Vidya Surendran
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash map in perl/tk
by zentara (Cardinal) on Jan 24, 2012 at 11:09 UTC | |
|
Re: Hash map in perl/tk
by Marshall (Canon) on Jan 25, 2012 at 00:27 UTC |