http://qs321.pair.com?node_id=301897

There are many ways to hide an email address within an HTML-page. Some use HTML entities or URI encoding. Others use JavaScript. I guess that the Spammer's harvesting robots can easily decode HTML entities or URI encoding (with Perl), but for JS they would need a JS-interpreter. So using JS seems a better way. The snippet uses a regex to replace the whole anchor (<a ...>...</a>) with a JS document.write of the splitted text. Maybe this is useful for someboby. Maybe you can direct me to a better regex. I've a version that uses HTML::TokeParser (less performant) instead, contact me if you are interested.
$html =~ s|(<[aA]\b # <a [^<>]*\b # any attributes [hH][rR][eE][fF]=\"? # href= [mM][aA][iI][lL][tT][oO]: # mailto: ([^\"\s<>]+) # EMAIL \"? # href closed [^<>]* # any attributes > # anchor closed (.+?) # TEXT </[aA]>) # </a> |antispamize($1, $2, $3)|sgex; sub antispamize { my($anchor, $email, $text) = @_; #$email =~ s/@/{at}/g; #$text =~ s/@/{at}/g; my $anchor = "<script language=\"JavaScript\">document.write('" . join("'+'", $anchor =~ /(.{1,4})/g) . "');</script>"; ## may be you want to add this #$anchor .= "<noscript>$text ($email)</noscript>"; return $anchor; }