#! /usr/bin/perl use strict; #array.pl my @array; for (1..10000) { my $x=$_; $x="a".$x; push (@array, $x); } foreach (@array) { print "$array[$_]=>$_", "\n"; } #### #! /usr/bin/perl use strict; #hash.pl my %hash; for (1..10000) { my $x=$_; $x="a".$x; $hash{$_}=$x; } foreach (keys %hash) { print "$hash{$_}=>$_", "\n"; } #### [sid@nucleix scope]$ time perl hash.pl > A real 0m0.103s user 0m0.097s sys 0m0.006s [sid@nucleix scope]$ time perl array.pl > B real 0m0.091s user 0m0.086s sys 0m0.005s