my %idcount; my @ids; for (0..5){ my $t=time(); push @ids, $t."-".++$idcount{$t}; }