On Tue, 2006-13-06 at 13:08 -0400, Mr. Shawn H. Corey wrote:
> $times{$hashkey}{home} = $time;
> $times{hashkey}{total} = $total;
>
> # Your code replaces, not augments
Consider adding this to your library of useful Perl utilities:
# --------------------------------------
# hset %hash, ( $key => $value, ... );
# Augment the hash with the key-value pairs.
# WARNING: This subroutine overwrites the value of any key that
already
# exists.
sub hset (\%%) {
my $hash_ref = shift;
my %kv_pairs = @_;
for ( keys %kv_pairs ){
$hash_ref->{$_} = $kv_pairs{$_};
}
}
--
__END__
Just my 0.00000002 million dollars worth,
--- Shawn
"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>