D
Derek Basch
If I am merging a blank hash into a populated hash how do I prevent
blank key/value pairs from being created?
This:
my %hash1 = ();
my %hash2 = (
key1 => 'cat',
key2 => 'dog'
);
my %hash3 = (%hash1, %hash2);
while (my ($key, $value) = each(%hash3)) {
print "$key: $value\n\n";
}
outputs:
blank key/value pairs from being created?
This:
my %hash1 = ();
my %hash2 = (
key1 => 'cat',
key2 => 'dog'
);
my %hash3 = (%hash1, %hash2);
while (my ($key, $value) = each(%hash3)) {
print "$key: $value\n\n";
}
outputs: