in reply to fetchrow_array returns an empty array

Use $sth->fetchrow_hashref instead. You can also use $sth->fetchrow_hashref($name) with $name being "NAME_lc" or "NAME_uc" so that column names in the hash can be predictably lower case or uppercase respectively.

Using hash references for data structures is much easier than using array references, since you don't need to keep track of the order of your columns and your code will be much more maintainable.

Also, don't slurp your query results into your program RAM. The server already manages the result set for you, so don't use up your program RAM to replicate the RDBMS result set.
Generally you want to iterate the result set with something like:

while(my $row = $sth->fetchrow_hashref()){ # evaluate $row->{column} here or # push any interesting $row to a local @array # (e.g. push @myarray, $row) }