for(my $i=0; $i < 100000; $i++) { $hash{'foo'.$i} = ''; # using a hash # ${'foo'.$i} = ''; # using dynamic variables } print "done\n"; ;