in reply to How to use pass and return hashes in a subroutine

I'm not completely sure what you are asking. What errors are you getting? I also like to pass a hash ref to subs when I can, like foo(\%hash); And yes, you can return a hash like:

return %foo; # my %hash = sub(\%hash); return $foo; # my $hash_ref = sub(\%hash);
Tell us what you have done, and is not working. I also suggest using 'my' and not 'local'. And redoing that part to be like:

my %arg = @_; my $key;

Cheers,
KM