use strict; use warnings; my %jetsons = ( 7 => 'Judy', 10 => 'Jane', 11 => 'George', 2 => 'Elroy', 100=> 'Rosey', 1 => 'Astro', 19 => 'Mr. Spacely', 22 => 'Mr. Cogswell' ); for my $i (0..100) { print "$i => $jetsons{$i}\n" if exists $jetsons{$i}; }