sub encodeemail{ my ($self, $email) = CGI::self_or_CGI(@_); my $char = ''; while ($email =~ /([a-z\@]{1})/is){ $char = '&#' . ord($1) . ';'; $email =~ s/$1/$char/sg; } return $email; }