Tomtom has asked for the wisdom of the Perl Monks concerning the following question:
to generate my hashtable.my %hash = map { (split /:/, $_ )[0] => (split /:/, $_ )[2] } <FILE>;
I only get the values : the keys are the result ofprint join ( "\n", sort keys %hash );
instead of the result of(split /:/, $_ )[2]
If I try to display the values with these keys, I get the "real" keys ...(split /:/, $_ )[0]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem generating a hashtable
by davidrw (Prior) on May 13, 2005 at 13:23 UTC | |
by techra (Pilgrim) on May 13, 2005 at 14:36 UTC | |
by Tomtom (Scribe) on May 13, 2005 at 13:34 UTC | |
by blazar (Canon) on Jul 19, 2005 at 14:23 UTC | |
|
Re: Problem generating a hashtable
by rev_1318 (Chaplain) on May 13, 2005 at 13:26 UTC | |
|
Re: Problem generating a hashtable
by mrborisguy (Hermit) on May 13, 2005 at 13:26 UTC | |
|
Re: Problem generating a hashtable
by holli (Abbot) on May 13, 2005 at 13:28 UTC | |
by Tomtom (Scribe) on May 13, 2005 at 13:38 UTC | |
by holli (Abbot) on May 13, 2005 at 13:40 UTC | |
by Tomtom (Scribe) on May 13, 2005 at 13:49 UTC |