Pushing data around from one array to the other is very unlikely to make things faster, probably the opposite. One thing you could so is write foreach my $word (split $line) to avoid the extra array, but this is something I suspect the Perl compiler might optimize all by itself already, you have top try whether it makes a difference. hashDescend() as a simple code block would probably be slightly faster, but other than that there's little room for optimization as far as I can see. Is this really too slow for your job?
in reply to Rewrite Program Using Arrays