Perl-Sensitive Sunglasses | |
PerlMonks |
Re^2: Substitute 'bad words' with 'good words' according to listsby sk (Curate) |
on Sep 26, 2005 at 03:00 UTC ( [id://495004]=note: print w/replies, xml ) | Need Help?? |
pg, I think the original code is not necessarily inefficient.I feel the performance depends on number of words your split returns.. Here is a benchmark of the original (added keys which was missing). I have modifed the txt to be 100 times the original one. Again the story could be different when you have way too many replacements and fewer words.
Output
NOTE: I removed the join from your code just to show the looping differences.
In Section
Seekers of Perl Wisdom
|
|