Esteemed Monks, sorry if I missed the answer to this in an earlier post.
I have a bit of code that I can't figure out why it's behaving like it is.
my @return_data_team; # This is not secure in JSON but how dojo requir
+es it.
while ( my $row = $sth->fetchrow_arrayref ) {
push (@return_data_team, $row);
print STDERR Dumper($row);
}
print STDERR Dumper(@return_data_team);
I see each $row as it should, but when I look at the array after the while loop, I see that each position in the array is pointing to the first position
VAR1 = [
'Richard Smith - Traffic Team',
'106990',
'156446',
'Traffic Team',
'Unknown'
];
$VAR2 = $VAR1;
$VAR3 = $VAR1;
$VAR4 = $VAR1;
$VAR5 = $VAR1;
$VAR6 = $VAR1;
$VAR7 = $VAR1;
$VAR8 = $VAR1;
$VAR9 = $VAR1;
$VAR10 = $VAR1;
$VAR11 = $VAR1;
I did find a solution by just passing the $sth->fetchall_arrayref instead of the array. However, I still want to understand why.
Thanks for your help in advance
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.