foreach (keys %a)
{
$b{$_} = $a{$_};
}
While this works, I wondered if there was a better way. I know the equivalent with arrays is easy.
@b = (@b,@a);
This might become significant for performance if one or other hash is not a real hash, but is tied to something.
Any thoughts?
In reply to Union of hashes by IvorW
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |