It sounds like you want to pass references to hashes. You can look this FAQ up by:
perldoc -q pass hash
perldoc perlreftut
Super Search on PM
#!/usr/bin/perl
use warnings;
use strict;
my %foo_hash = qw/elmer fudd slyvester cat/;
my %bar_hash = qw/bugs bunny tweety bird/;
foo(\%foo_hash,\%bar_hash);
sub foo {
my ($hash1,$hash2) = @_;
foreach (keys %$hash1) {
print "$_ $$hash1{$_}\n";
}
foreach (keys %$hash2) {
print "$_ $$hash2{$_}\n";
}
}
Wooohooo this is my 50th post
grep
grep> cd pub
grep> more beer
|