chariscomp has asked for the wisdom of the Perl Monks concerning the following question:
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:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to use pass and return hashes in a subroutine
by chromatic (Archbishop) on Aug 21, 2000 at 23:43 UTC | |
|
RE: How to use pass and return hashes in a subroutine
by KM (Priest) on Aug 21, 2000 at 23:47 UTC | |
|
Re: How to use pass and return hashes in a subroutine
by le (Friar) on Aug 21, 2000 at 23:50 UTC |