sub hpush (\%@) { my ($hash, %add) = @_; $hash->{$_} = $add{$_} for keys %add; } my %config = ( home => '/home/foo', temp => '/tmp' ); hpush %config, root => '/root', sbin => '/usr/sbin';
In reply to Re: Adding multiple items to a hash
by Anonymous Monk
in thread Adding multiple items to a hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |