I've been wondering for a long time... is there a slick (and hopefully fast!) way to do this?
foreach (keys %fixhash) {
$x=~s/\b$_\b/$fixhash{$_}/gi;
}
So if
$x="this could be so cool"
and
$fixhash{"could"}="would";
$fixhash{"COOL"}="awesome";
$fixhash{"beso"}="nope";
$fixhash{"his"}="impossible";
then it would end up
"this would be so awesome"
Thanks!
David
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
