Ricardo SIGNES wrote:

> [Good points, all]

> (b) make %queue an array; if it's really a queue (and you're going to be
> shifting work off the bottom) an array is more natural.  Then the loop
> would read:
>         while ($sth->fetchrow_hashref) {
>                 push @queue, $_;
>         }
>
> (I believe this look should work now.  I think there's a caveat in the
> DBI docs that someday fetchrow_hashref may return the same hashref with
> new values every time.)

Why recommend an approach that is being deprecated?  I'd suggest that you [and
the OP] use the references returned only in transit, and get that information
into locally declared and allocated data structures as soon as possible.
There are good reasons for a DB access module to keep the memory footprint of
its transfer structures small.  Client-side storage for the data should be in
memory "owned" by the client, not in memory borrowed from an interface.

Thanks for passing on this warning.  I probably would have thought nothing of
pushing the refs into a local data structure had you not pointed this out.
Once you did, it became instantly clear why the DBI authors would wish to move
in this direction.

>
>
> > IMPORTANT NOTICE  This email (including any attachments) is meant only
> > for the intended recipient.
>
> It would be nice if you could not send this disclaimer.  I realize that
> might not be an options.

Ditto.  Oh well, it probably can't be helped.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to