in reply to Re: Sorting files you Have read
in thread Sorting files you Have read

If you are going to use strict; use warnings; (and it is a really really good idea), then you really really need to declare your variables: ;)

use strict; # a good idea use warnings; # and another my $input = 'myinput.txt'; open(my $in, "<", $input) or die "Could not open $input because $!\n"; my @unsorted = <$in>; chomp (@unsorted); # get rid of end-of-record markers close ($in); my @sorted = sort @unsorted;

DWIM is Perl's answer to Gödel