Ok,
I think I've decided to go with 'assign'
1) Because the benchmark difference isn't much:
splice 2008032/s -- -3%
assign 2074689/s 3% --
2) And duplicate keys become the value of the newest hash on both ways:
use Data::Dumper;
my %w = (1=>2,3=>4);
my %q = (3=>6,7=>8);
@q{keys %w} = values %w;
print Dumper \%q;
%q = (3=>6,7=>8);
%q = (%q, %w);
print Dumper \%q;
$VAR1 = {
'1' => 2,
'3' => 4,
'7' => 8
};
$VAR1 = {
'1' => 2,
'3' => 4,
'7' => 8
};
3) It is less typing :)
Thanks again for all the ideas!
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>