Hello,

I have some data that is pipe-delimited, that I would like to sort
on the first column (numeric).  The data looks like this:

173|Supertramp|The Very Best of Supertramp
19|Story, Liz|My Foolish Heart
54|Tchaikovsky|Nutcracker Suite
187|Tesla|Time's Makin' Changes: The Best of Tesla

and once sorted, it should look like

19|Story, Liz|My Foolish Heart
54|Tchaikovsky|Nutcracker Suite
173|Supertramp|The Very Best of Supertramp
187|Tesla|Time's Makin' Changes: The Best of Tesla

I tried usint "sort {$a <=> $b}" but got an error:

Argument "173|Supertramp|The Very Best of Supertramp" isn't numeric
in sort at med2cdr.pl line 1.

So I know I have to write my own sort sub-routine, perhaps using
'split', but I haven't a clue where or how to write that.

Any help would be greatly appreciated!


TIA

Jeff



        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to