Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
(There are only 2 records in the DB right now.) When I display the contents of $before, I get the values of the first field of each returned row. But when I display the contents of $after I just get the first field of the second row, repeated twice. Also, I tried changing the first value directly with ${$returnme1}[0] = "HI"; which results in $after returning "HIHI" instead of only modifying one value - the same happens if I go for element 0 instead of 1. It can't be a referencing problem if it works both ways right? I have no idea why this is happening, if anyone could give me some advice that would be fantastic.while ($result = $sth->fetchrow_arrayref) { $before.= $$result[0]; push (@returnme, $result); } $after.= ${$returnme[0]}[0]; $after.= ${$returnme[1]}[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Crazy array of references behavior
by shenme (Priest) on Dec 01, 2003 at 15:32 UTC | |
by Anonymous Monk on Dec 01, 2003 at 16:02 UTC | |
|
Re: Crazy array of references behavior
by dragonchild (Archbishop) on Dec 01, 2003 at 18:05 UTC | |
by cLive ;-) (Prior) on Dec 01, 2003 at 19:42 UTC | |
by Anonymous Monk on Dec 01, 2003 at 21:46 UTC |