in reply to How can I get the last element of an array inside of fetchall_arrayref?
Your 2 examples have slightly different logic. In your first example (with the database) you are pushing and printing inside the loop. In your second example you are pushing inside the loop but printing outside it. This explains the difference in the outputs you are seeing.
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I get the last element of an array inside of fetchall_arrayref?
by Lewisa (Novice) on Mar 23, 2021 at 17:57 UTC | |
by hippo (Archbishop) on Mar 23, 2021 at 18:45 UTC | |
by Lewisa (Novice) on Mar 23, 2021 at 20:09 UTC | |
by Lewisa (Novice) on Mar 24, 2021 at 01:20 UTC |