in reply to selectall_hashref

The document I read said that the second parameter is "the column to use as key, indicated by position".

What document was that? Look at the docs for fetchall_hashref, it works the same way (except you have to call prepare and execute), and has an example:

$dbh->{FetchHashKeyName} = 'NAME_lc'; $sth = $dbh->prepare("SELECT FOO, BAR, ID, NAME, BAZ FROM TABLE"); $sth->execute; $hash_ref = $sth->fetchall_hashref('id'); print "Name for id 42 is $hash_ref->{42}->{name}\n";
Update: I do also see this for fetchall_hashref, so you may be right (in some other version of documentation from mine), but try it both ways:
The $key_field parameter can also be specified as an integer column nu +mber (counting from 1).
Update: nevermind...see correct answer below.