XP is just a number | |
PerlMonks |
hash with identical keysby props (Hermit) |
on Dec 06, 2007 at 22:06 UTC ( [id://655528]=perlquestion: print w/replies, xml ) | Need Help?? |
props has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks
Iam trying to solve an exercise from the textbook Intermediate Perl (8.6.2).
the following data is stored in a file named data.
Gilligan: 1 coconut Skipper: 3 coconuts Gilligan: 1 banana Ginger: 2 papayas Professor: 3 coconuts MaryAnn: 2 papayas I have to create for each name a respective file such as this gilligan.info with its fruit written in the file . Like gilligan.info must have written in it : Gilligan: 1 coconut Gilligan: 1 banana.
The trouble is that i shouldn't be using hash because there are 2 identical key entries(Gilligan). Now I've experimented with HoA with no luck some guidance is more than welcome
Back to
Seekers of Perl Wisdom
|
|