- or download this
#!/usr/bin/perl
...
my $j2 = join ' ', sort( @array2 );
$answer{sortjoin} = ( $j1 eq $j2 ) ? 'same':'diff';
}
- or download this
$ test.pl
Rate sortcomp hash sortjoin
...
results: hash:same sortjoin:same sortcomp:same
- or download this
test.pl 90 ## array size = 90 (lots of repeat values)
Rate sortcomp sortjoin hash
...
results: hash:same sortjoin:same sortcomp:same