#!/usr/local/bin/perl # Jaime Prilusky, 2002 # data from http://www.genomesize.com/ # initialize a 'mammals' hash with key-value pairs my %mammals = ( "Ornithorhynchus anatinus" => 54, "Tachyglossus aculeatus" => 64, "Gorilla gorilla" => 48, "Homo sapiens" => 48, "Pan troglodytes" => 48, "Pongo pygmaeus" => 48, ); # print the entire hash, sorted by specie print "\n"; foreach $specie (sort keys %mammals) { my $diploidNumber = $mammals{$specie}; printf ("%30s %d\n",$specie,$diploidNumber); } delete($mammals{'Ornithorhynchus anatinus'}); # print the entire hash, sorted by specie print "\n"; foreach $specie (sort keys %mammals) { my $diploidNumber = $mammals{$specie}; printf ("%30s %d\n",$specie,$diploidNumber); }