in reply to Searching for text not inside a hyperlink

Your problem is not searching inside HTML links, but replacing inside what you already replaced in a previous loop. So: don't do multiple loops, instead, replace everything in one go. Build a regex with all search terms first, and do the substitution with a hash. Something like this:
$_ = <<'--'; Oh no, Anti-globalization activists are coming! Globalization is rejected by... -- use Regex::PreSuf; %links = ( 'globalization' => '/encyclopedia/Globalization/index.html', 'anti-globalization' => '/encyclopedia/Anti-Globalization/index.htm +l' ); my $re = presuf(keys %links); s/($re)/<a href="$links{lc $1}">$1<\/a>/gio; print;
Result:
Oh no, <a href="/encyclopedia/Anti-Globalization/index.html">Anti-glob +alization</a> activists are coming! <a href="/encyclopedia/Globalization/index.html">Globalization</a> is +rejected by...
Regex::PreSuf is a module to build a regex out of a list of words. It'll escape metacharacters, so the resulting regex will always just do literal lookups.

Do note how I made the replacement case-insensitive, making the keys of the hash lower case, and doing the lookup with lc $1 — in addition to use of the /i switch.