in reply to How to sort?

Assuming it is indeed a CSV-file (and you just forgot to add the commas:
use strict; use DBI; my $dbh = DBI->connect('dbi:AnyData:'); $dbh->func( 'test', 'CSV', 'test.csv', {sep_char => ',', eol => "\n", col_names => 'number,name', }, 'ad_catalog', ); my $sth = $dbh->prepare("SELECT number, name FROM test ORDER BY name") +; $sth->execute(); while ( my $row = $sth->fetch ) { print "@$row\n"; }
Which prints:
2 Alfred 3 Barry 2 Bob 1 Charlie 1 Edward

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James