use strict; use warnings; use Data::Dumper; my @fields; GetTables('ABC', \@fields); print Dumper(\@fields); sub GetTables { my ($table_name, $aref) = @_; my %tables = ( 'ABC' => [ qw( f1 f2 f3) ], 'DEF' => [ 'f1', 'f2' ], ); @$aref = $tables{$table_name}; ## originally I had the following, but it didn't work ## $aref = $tables{$table_name}; print Dumper(\%tables, $aref); }