in reply to How to use pass and return hashes in a subroutine
If you pass a hash-ref to your sub, it would look like this:
&loop_print(\%c); sub loop_print { my $href = shift; foreach (keys %{$href}) { print "$_: ${$href}{$_}\n"; } }
|
---|
In Section
Seekers of Perl Wisdom