If $self->{ACLS} is a hashref, then one way to correct this is to return the hashref directly and cast it into a hash in your loop declaration:
sub acls { my $self = shift; # my %acls = \$self->{ACLS} # $self->{ACLS} is a hashref # return %acls; return $self->{ACLS}; } foreach(keys %{$mod->acls}) { # code in here }
You must make sure to include the extra braces around $mod->acls or it will try to interpret %$mod before $mod->acls. Hope this helps!
In reply to Re: Hashes as return values
by thedoe
in thread Hashes as return values
by dirtdart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |