||After having spent the better part of a day figuring out how perfectly good UTF-8 data out of a MySQL database was being mangled by Perl, I found that this was caused by Perl upgrading the string which was already UTF-8 (but didn't have the internal UTF-8 flag set). So I needed a way to set that flag, I found the "_utf8_on" of Encode through graff's answer Re: restore unicode data from database?.
However, doing this "manually" on everything you fetch out of a database, becomes tedious quickly. Since I frequently use the selectall_arrayref fetching methods, I created this little sub that could can "wrap" around such a call.
It expects the arrayref of arrayrefs as input, and also returns it. So you can "inline" the call to "_utf8_on_all_arrayref".