in reply to returning nested data structures

When you say 'module', do you really mean 'sub'? If so, you should show how you are calling your sub. This is a way to return a hash-of-arrays from a sub:
use strict; use warnings; my %filt = foo(); use Data::Dumper; print Dumper(\%filt); sub foo { # Create a hash-of-arrays my %filters = ( a => [0..2], b => [3..5] ); return %filters; } __END__ $VAR1 = { 'a' => [ 0, 1, 2 ], 'b' => [ 3, 4, 5 ] };
You could also return it as a reference to a HoA.