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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Sorting files you Have read
by brusimm (Pilgrim) on Nov 16, 2006 at 23:34 UTC | |
by robot_tourist (Hermit) on Nov 17, 2006 at 16:48 UTC |
In Section
Seekers of Perl Wisdom