Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have array which stores names given from on screen prompt, then want to print the values for these nameshash: %random_name = ( $bob => "something", etc );
Nothing is printed, if i replace $random_name{$_}; with $random_name{$bob}; it works fine? Thanksforeach (@array) { $value = $random_name{$_}; print "value: $value\n"; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: calling a hash
by cbrandtbuffalo (Deacon) on Oct 04, 2005 at 11:54 UTC | |
by Anonymous Monk on Oct 04, 2005 at 13:26 UTC | |
by blazar (Canon) on Oct 04, 2005 at 13:37 UTC | |
|
Re: calling a hash
by blazar (Canon) on Oct 04, 2005 at 11:20 UTC | |
by Anonymous Monk on Oct 04, 2005 at 11:28 UTC | |
by blazar (Canon) on Oct 04, 2005 at 12:06 UTC | |
|
Re: calling a hash
by Samy_rio (Vicar) on Oct 04, 2005 at 11:24 UTC | |
by blazar (Canon) on Oct 04, 2005 at 11:28 UTC |