my problem is to sort emails.txt that in emails.txt will not be emails with gmail.com i started to write: #!/usr/local/bin/perl open (MYFILE, 'emails.txt'); while ($line=<MYFILE>) { chomp; print $line; } close (MYFILE); how to modify this code?
open(MYINPUTFILE, "<emails.txt"); @dataarray = <MYINPUTFILE>; @sort = sort(@dataarray); close(MYINPUTFILE); open(MYINPUTFILE, ">emails.txt"); foreach $name (@sort) { chomp; print MYINPUTFILE "$name"; } close(MYINPUTFILE); This should help