in reply to How can I get the last element of an array inside of fetchall_arrayref?

Not related to your question, but: do you use warnings? They should have told you
Scalar value @total[-1] better written as $total[-1] at ...

If you know you only want one element from the array, use the dollar sign. At sign is for two and more, e.g. @total[1, 2].

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

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 18:09 UTC
    Hey Chroba, thanks for responding. Yes I use strict and warnings. I meant to delete those lines of code because they didn't work. I had them commented out.