hello,

i think i found a little bug in DBI:
version 1.14

have a look on:

  $ary_ref  = $sth->fetchrow_arrayref;
  $hash_ref = $sth->fetchrow_hashref;

the situation is, when getting a reference from fetchrow_hashref, it is possible
to get access also after using this method again to a stored value...eg:



 while (my $ref=$obj->fetchrow_hashref()){
  push @arr,$ref;
 }

print $arr[0]->{fieldname};
print $arr[1]->{fieldname}; # is a different value and that is ok i think

but using this:

 while (my $ref=$obj->fetchrow_arrayref()){
  push @arr,$ref;
 }

 print $arr[0]->[0];
 print $arr[1]->[0]; # is the same value as before

....so by using fetchrow_arrayref the $ref directs always to the SAME memory place.
is this right? i believe not. i think theres no problem to allocate more memory for a 
new
array again because wehn @arr dies, the garbage collector will tidy up the memory.

what do you think?


-----------------------------------------
Andreas Hernitscheck
mailto:[EMAIL PROTECTED]
 
PGP: http://download.tool.de/pgp/anhe.asc

Reply via email to