my %hash; for my $i (0..5) { for my $j (0..5) { $hash{ $i,$j } = $i*$j; } } foreach ( keys %hash ) { print "$_ : ", $hash{ $_ }, "\n"; }