On Thu, Apr 18, 2002 at 07:56:06PM -0000, Lars Henrik Mathiesen wrote:
> What I've sometimes wished for is some way of dereffing to a hash or
> array using -> or some related postfix thing. So instead of
>
> my $aref = $hash{foo};
> for my $key ( keys %$aref ) { print $hash{bar}->{$key} }
>
> or
>
> for my $key ( keys %{ $hash{foo} } ) { print $hash{bar}->{$key} }
>
> I would like to write
>
> for my $key ( $hash{foo}->keys ) { print $hash{bar}->{$key} }
>
> or even
>
> for my $key ( keys $hash{foo}->% ) { print $hash{bar}->{$key} }
>
> ... I'd find these easier to make sense of, though I've got a sneaking
> suspicion that I'm in a small minority there. But of course they'd be
> fun, because I could inflict them on unsuspecting readers of my code.
This, or something similar was hashed out on p5p, ooooh, about 4 years
ago, give or take four years ;-) Actually, I think it might have been
when Chip was Pumpking, which would have made it about five years ago.
You could search the archives. I would have done had I been able to
think of something sensible to search for.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net