use strict; my @hashes = ({}) x 10; $hashes[$_]{$_} = 1 foreach (0 .. 9); foreach (0 .. 9) { print join(':', keys %{$hashes[$_]}), "\n" } #### 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 6:3:7:9:2:8:1:4:0:5 #### 0 1 2 3 4 5 6 7 8 9 #### my @hashes = map{{}} (0 .. 9);