RULES a ($id)\@($id)==>$1\@\@$2 RULES b \@\@==>\@ ENDRULES $id='[\w_.-]+'; while(<>){print b(a($_))} =head1 substitutes the emails with html links. Tricks used: ($id)\@($id)==>