Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Can a hash name have the same value twice.

by turnstep (Parson)
on May 02, 2000 at 23:35 UTC ( [id://9974]=note: print w/replies, xml ) Need Help??


in reply to Can a hash name have the same value twice.

Here is a simple way to do it:
open(MYFILE, "$cityfile") || die "Could not open $cityfile: $!\n"; while(<MYFILE>) { chomp; ($city, $country) = split(/:/, $_); $place{$country} .= "$city#"; } close(MYFILE); for $x (keys %place) { print "$x:\n"; for (split(/#/, $place{$x})) { print "\t$_\n"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://9974]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-18 00:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found