- or download this
my %hash = (
...
sub foo {
print join(' | ', @_), "\n";
}
- or download this
sub foo {
my %hash = @_;
...
# not good at all
foo(@names, %hash);
- or download this
# pass a reference to %hash, which is a scalar
foo(\%hash);
...
sub foo {
my $hashref = shift;
}
- or download this
sub foo {
my $hashref = shift;
...
my $hashref = shift;
# manipulate data as above
}