use strict; use Data::Dumper; my %test = (key1 => "value",key2 => "value2"); my %test2 = (key3 => "value3",key4 => "value4"); test_sub([keys %test], [keys %test2]); sub test_sub{ my $ref_arr = shift; my $ref_arr2 = shift; print Dumper($ref_arr); print Dumper($ref_arr2); }
Conclusion:
$VAR1 = [ 'key2', 'key1' ]; $VAR1 = [ 'key4', 'key3' ];
source share