in reply to Re: promoting array to a hash
in thread promoting array to a hash
...only about 350x slower. YMMVgreg@spark:~/test$ cat sleepingsquirrel #!/usr/bin/perl print "$_\n" for sort keys %{{map {$_,()} grep /^[a-z]+$/, (split /\s/ +, join(" ",<>))}}; greg@spark:~/test$ time sleepingsquirrel Net-HOWTO >words.txt real 0m0.178s user 0m0.158s sys 0m0.016s greg@spark:~/test$ cat jasper #!/usr/bin/perl $/=undef; print "$_\n" for sort <> =~ /\b([a-z]+)\b(?!.*\b\1\b)/sg greg@spark:~/test$ time jasper Net-HOWTO >words2.txt real 1m8.477s user 1m8.471s sys 0m0.003s
|
|---|