while(){ chop(); s/NEWLINE/ /g; s/SEMICOLON/\;/g; if (/\@/){ $count=0; while(/[\s\<\;\=](\w+\@[\w\.]+)[\s\>\;]/g){ $count ++; $address=$1; $address=~s/[\.\,]$//; $address=~tr/A-Z/a-z/; print "$address\n"; } } }