brusimm has asked for the wisdom of the Perl Monks concerning the following question:
I want to open a file with multiple columns. (Redundant statement, seeing as how I want to sort on the first column)
I can open a file, read through it and print it to screen.
But I can't seem to locate the key process on sorting the contents of a file before printing to screen, never mind printing it to a file.
I have procured the O'reilly book, learning perl.
I have scoured many websites... but I cannot connect the dot or dots to make my task come to fruition.
Hence, assistance is asked for...
Here is the code I've been using, without the sort routine:
open (SOMELIST, "somelist"); #opening standings, putting in array +SOMELIST while ($record = <SOMELIST>) { print $record; } close (SOMELIST)
Where / how does one sort somelist?
Any / all help, input, prewritten code (optimal, seeing as how my logic evades the dots connecting.) would be appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sorting files you Have read
by GrandFather (Saint) on Nov 16, 2006 at 21:16 UTC | |
by brusimm (Pilgrim) on Nov 16, 2006 at 21:30 UTC | |
by GrandFather (Saint) on Nov 16, 2006 at 21:56 UTC | |
by brusimm (Pilgrim) on Nov 16, 2006 at 23:09 UTC | |
by markh (Scribe) on Nov 16, 2006 at 22:25 UTC | |
by GrandFather (Saint) on Nov 16, 2006 at 23:07 UTC | |
Re: Sorting files you Have read
by swampyankee (Parson) on Nov 16, 2006 at 21:24 UTC | |
by GrandFather (Saint) on Nov 16, 2006 at 23:16 UTC | |
by brusimm (Pilgrim) on Nov 16, 2006 at 23:34 UTC | |
by robot_tourist (Hermit) on Nov 17, 2006 at 16:48 UTC | |
by brusimm (Pilgrim) on Nov 16, 2006 at 23:07 UTC | |
by swampyankee (Parson) on Nov 16, 2006 at 23:36 UTC | |
Re: Sorting files you Have read
by Fletch (Bishop) on Nov 16, 2006 at 21:22 UTC |