in reply to Dereferencing fetchall_arrayref({})

Fetchall arrayref returns a reference to an Array of Arrays, so to reference an item of data you need an extra subscript, like this

$data->[0]->[0]

You can see this clearly by dumping the reference, either in the debugger or with Data::Dumper.

It might help to conceptualise the referenced data as a set of rows, each row having a set of columns.

Update: I'm wrong about the AoA, (nicely picked up by dragonchild) but advice about debugger (use 'x') and Data::Dumper still stand.