Quote:
Originally Posted by stukov
Furhter testing indicates that :
Code:
foreach my $i (@$attributes)
{
print $i . ENDL;
}
works but
Code:
foreach my $i (%$attributes)
{
print $i . ENDL;
}
does not.
Now, how am I expected to provide a key-value pair when I need to work with an array?
|
like i said before, $attributes is an array reference and an array is not equivalent to a hash. you can't use an array reference as a hash reference or the other way around. (internally they have a different DS)
though, assigning an array to a hash and vice-versa is valid (with a caveat) , please see the example i gave earlier (#6).