in reply to Re: A dereferencing problem
in thread A dereferencing problem

It does sort of look that way, doesn't it? I think the code suggests the HoA structure though. If he were using code references, the assignment line would be more like  ($value1, $value2)= &{$ref->{$key}} with the assumption that the referenced function returned a list. If the referenced function returned a pointer to an array then the assignment would be  ($value1, $value2)= @{&{$ref->{$key}}} which is getting decidedly unlovely in appearance.

PJ

Replies are listed 'Best First'.
Re: Re: Re: A dereferencing problem
by revdiablo (Prior) on Apr 29, 2004 at 23:14 UTC
    It does sort of look that way, doesn't it?

    No, it doesn't look that way, it is that way. I was pretty sure he meant that there was an array reference at that key, but trying to point out that the actual syntax of his "example" was something completely different (that is, calling a coderef stored in the hash).

    Incidentally, your two examples can be written as ($value1, $value2) = $ref->{$key}->() and ($value1, $value2) = @{ $ref->{$key}->() }, which I find more readable.