It's not documented what selectall_hashref() will do when the key field
or fields you've chosen are not unique. For example (Sybase SQL):
$dbh->selectall_hashref(
'select 5 as a, 6 as b union select 5 as a, 7 as b',
'a'
);
Here there are two rows with the same value for column 'a'.
Personally, I think it should raise an error in this situation, since
the programmer is probably expecting the key fields to be unique and
if they're not then there is a wrong assumption somewhere. However,
that would break compatibility with the current behaviour (even though
that behaviour is not documented).
So maybe just change the documentation from 'one row, at most' to state
explicitly that the first row returned from the database is the one
chosen, or something like that.
--
Ed Avis <[EMAIL PROTECTED]>