James Edward Gray II wrote:
> On Nov 11, 2003, at 2:08 PM, Christiane Nerz wrote:
>
>> Nope - 'cause if I print out the values key for key, I get all four:
>>
>> my $array = keys %hash;
$array is a scalar, which gets the number of keys in %hash. not the actual
keys in %hash. you probably want my @array = keys %hash;
>>
>> print $hash{$array[0]};
>> print"\n";
>> print $hash{$array[1]};
>> print"\n";
>> print $hash{$array[2]};
>> print"\n";
>> print $hash{$array[3]};
where is @array declared? how does it get the keys of %hash?
>>
>> With the code
>> foreach (keys %hash) {
>> print $hash{$_};
>> print "\n";}
>>
>> I only get the value corresponding to $hash{$array[3]}.
as far as printing out the values of %hash is concerned, there is nothing
wrong with this piece of code. if you only see one value, you either have
one key in your %hash or all your keys in the hash contain exectly the same
value, $array[3] in this case. the problem most likely originated in other
part of your script. for example, how do you store the keys in %hash?
david
--
$_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$";
map{~$_&1&&{$,<<=1,[EMAIL PROTECTED]||3])=>~}}0..s~.~~g-1;*_=*#,
goto=>print+eval
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]