use strict; use warnings; sub processInterfaceData (\%\%) { my ($h, $nh) = @_; foreach my $key (keys %{$h}) { print "$key\n"; } } my %myUnitIfs; my %config; processInterfaceData($config{units}{myUnit}{interfaces}, %myUnitIfs); #### Type of arg 1 to main::processInterfaceData must be hash (not hash element)