in reply to Adding multiple items to a hash
sub hpush (\%@) { my ($hash, %add) = @_; $hash->{$_} = $add{$_} for keys %add; } my %config = ( home => '/home/foo', temp => '/tmp' ); hpush %config, root => '/root', sbin => '/usr/sbin';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Adding multiple items to a hash
by Stevie-O (Friar) on Mar 03, 2004 at 00:14 UTC |