in reply to Help with converting Python script to Perl for CSV sort

Can the same code be used for both?

Not exactly, to sort field 2 alpha

sort { $a->[1] cmp $b->[1] }

or field 1 numeric

sort { $a->[0] <=> $b->[0] }
poj

Replies are listed 'Best First'.
Re^2: Help with converting Python script to Perl for CSV sort
by jasonwolf (Sexton) on Jan 31, 2017 at 15:40 UTC
    Understand... Thank you. I am currently reviewing the "sort" page to understand the capabilities. Much appreciated.