in reply to Re: Multidimensional Hash
in thread Multidimensional Hash

Why reinventing (badly) the wheel?

my $query = qq(SELECT id, col1, col2 FROM some_table); my $results = $dbh->selectall_hashref($query, 1);

Read all the explanation in DBI and DBI Recipes.

Replies are listed 'Best First'.
Re^3: Multidimensional Hash
by Prior Nacre V (Hermit) on Aug 07, 2004 at 06:16 UTC
    • The original question was somewhat vague in terms of requirements
    • I provided a generic template using methods that I knew would be available without knowing the version of DBI in use
    • You are at liberty to dislike my solution
    • Constructive criticism might have been a better approach

    Many Internet Service Providers (ISPs) take the "if it ain't broke, don't fix it" approach. For instance, the ISP I moved from almost a year ago still uses a version of DBI that does not support the selectall_hashref() method.

    Regards,

    PN5