Perl Monk, Perl Meditation | |
PerlMonks |
Re: How can I get the last element of an array inside of fetchall_arrayref?by hippo (Bishop) |
on Mar 23, 2021 at 17:47 UTC ( [id://11130222]=note: print w/replies, xml ) | Need Help?? |
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. 🦛
In Section
Seekers of Perl Wisdom
|
|