>>77
これでどう?

$text =~ s/(?:(&(?:yen|euro|amp|copy);)|&)/$1?$1:"&"/ge;