my @rand; for (1..10) { # add a random number of elements to the array push @rand => $_ for (0 .. ((rand() * 10) % 10)); my $rand_id = time() . " " . { time => time() } . " " . rand() . " " . $$; printf "%s\n", $rand_id; } __OUTPUT__ 1092953284 HASH(0x1806be4) 0.351068406456278 15758 1092953284 HASH(0x180820c) 0.581041221829715 15758 1092953284 HASH(0x1808230) 0.936157439122312 15758 1092953284 HASH(0x1808284) 0.183180004399297 15758 1092953284 HASH(0x18082c0) 0.943342015904591 15758 1092953284 HASH(0x1808338) 0.424439000654708 15758 1092953284 HASH(0x1808350) 0.935454533284215 15758 1092953284 HASH(0x180838c) 0.771976549032949 15758 1092953284 HASH(0x1808398) 0.549340888274884 15758 1092953284 HASH(0x18083e0) 0.984217993290265 15758