I tried the above example but it didn't work for me.

I got the following error:

C:\Documents and Settings\user\D esktop\abc\trun k\docs>perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}'db_ em
ails.txt | sort -u > output.txt
Can't find string terminator "'" anywhere before EOF at -e line 1.
-uThe system cannot find the file specified.