in reply to [untitled node, ID 254219]

Maybe I'm being dense this morning but won't this do it:
while (my $ret = $sth->fetchrow_hashref) { my %user = %$ret; ... }
Although I would argue that your code is making an unnecessary copy of an unnecessary copy. So hopefully you aren't optimizing for performance... just programmer flexibility.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: •Re: Hash from DBI
by broquaint (Abbot) on Apr 30, 2003 at 09:40 UTC
    Or even more directly
    while (my %user = %{ $sth->fetchrow_hashref }) { ... }

    HTH

    _________
    broquaint