in reply to sorting comma separated value file

This isn't exactly a Perl answer...

But if you're on UNIX, the sort command does exactly what you need already:

sort -t, -kn in_file
-t specifies the field separator (a comma in this case)
-k specifies the number of the field to sort on (replace n with your favorite number)

Update: Oops, I missed the part about "Practice Example." Nevermind. Definitely check out the Schwartzian Transform nodes, in that case.

Alan