Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$i = 1; %hash = ( ('abc' => 7) if (! $i), 'hk' => 5, 'jk' => 6 ); foreach $key (keys %hash) { print "the key is $key and val is $hash{$key}\n" }
2005-02-05 Edited by Arunbear: Changed title from 'Problem with hash', as per Monastery guidelines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Initializing a hash using conditions
by dave_the_m (Monsignor) on Feb 03, 2005 at 12:04 UTC | |
|
Re: Initializing a hash using conditions
by Anonymous Monk on Feb 03, 2005 at 12:06 UTC | |
by Random_Walk (Prior) on Feb 03, 2005 at 13:19 UTC | |
|
Re: Initializing a hash using conditions
by holli (Abbot) on Feb 03, 2005 at 12:04 UTC | |
|
Re: Initializing a hash using conditions
by monkey_boy (Priest) on Feb 03, 2005 at 12:03 UTC | |
|
Re: Initializing a hash using conditions
by rir (Vicar) on Feb 03, 2005 at 14:34 UTC | |
|
Re: Initializing a hash using conditions
by punkish (Priest) on Feb 03, 2005 at 12:29 UTC | |
|
Re: Initializing a hash using conditions
by stvn_skuo (Initiate) on Feb 04, 2005 at 07:07 UTC |