Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Perl: reverse Hash

Perl: reverse Hash
{filelink=14712}

#!/usr/local/bin/perl
my% myHash = ("Germany" => "Berlin"
     "England" => "London"
     "France" => 'Paris');
foreach $contry (sort keys %myHash)
{
    print "$myHash{$contry} ==> $contry.n";
}
# reverse the Hash
%myHash=reverse(%myHash);
# Afficher les éléments
print "after reversing
";
foreach $contry (sort keys %myHash)
{
    print "$myHash{$contry} ==> $contry.n";
}

Users who found this page were searching for:

  • python dictionary add entry
  • perl array creation
  • perl rename directory
  • python getelements
  • python file close

No comments yet.

Leave a Comment