sub loop_print2 {
local(%arg=$_[0],$key);
foreach $key (sort keys %arg) {
print "$key:\t$arg{$key}\n";
}
}
I am calling it like this &loop_print2(%c); where %c is a hash that is already populated from a previous function call. I am also trying to find out how to return a hash from a function. Can I build it up and then use something like:In reply to How to use pass and return hashes in a subroutine by chariscomp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |