spickles has asked for the wisdom of the Perl Monks concerning the following question:
Why does an array hash throw out duplicate values? I have a database of objects (34 in total) and of the 7 or 8 different keys, 6 are the same with the other two being unique. When I place these keys into an array hash by querying the database and pulling from the database records it tosses out duplicates. I want to keep them.
Example input:
JP-AP1-1-RM_210,Johanna Perrin,wism3-1,10.137.139.2,wism4-1,10.137.139 +.6,wism7-1,10.137.139.10,JP,149,not_configured JP-AP1-2-RM_207,Johanna Perrin,wism3-1,10.137.139.2,wism4-1,10.137.139 +.6,wism7-1,10.137.139.10,JP,153,not_configured JP-AP1-3-RM_203,Johanna Perrin,wism3-1,10.137.139.2,wism4-1,10.137.139 +.6,wism7-1,10.137.139.10,JP,157,not_configured JP-AP1-3A-RM_203,Johanna Perrin,wism3-1,10.137.139.2,wism4-1,10.137.13 +9.6,wism7-1,10.137.139.10,JP,36,not_configured JP-AP1-4-RM_204,Johanna Perrin,wism3-1,10.137.139.2,wism4-1,10.137.139 +.6,wism7-1,10.137.139.10,JP,161,not_configured JP-AP1-5-RM_201,Johanna Perrin,wism3-1,10.137.139.2,wism4-1,10.137.139 +.6,wism7-1,10.137.139.10,JP,149,not_configured
Example output:
JP-AP1-1-RM_210,,,,,,,,,149,not_configured, JP-AP1-10-RM_102,,,,,,,,,161,not_configured, JP-AP1-11-RM_101,,,,,,,,,149,not_configured, JP-AP1-12-RM_100,,,,,,,,,153,not_configured, JP-AP1-13-RM_Cafe_Serv_B,,,,,,,,,149,not_configured, JP-AP1-13A-RM_Cafe,,,,,,,,,36,not_configured, JP-AP1-14-RM_300,,,,,,,,,157,not_configured,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash throws out duplicate values
by ikegami (Patriarch) on Oct 12, 2009 at 08:49 UTC | |
by spickles (Scribe) on Oct 12, 2009 at 08:56 UTC | |
by ikegami (Patriarch) on Oct 12, 2009 at 09:17 UTC | |
by Marshall (Canon) on Oct 12, 2009 at 10:20 UTC | |
by spickles (Scribe) on Oct 15, 2009 at 14:53 UTC | |
by Marshall (Canon) on Oct 15, 2009 at 18:30 UTC | |
|
Re: Hash throws out duplicate values
by Anonymous Monk on Oct 12, 2009 at 08:55 UTC |