in reply to Re: keys function question
in thread keys function question
Okay, so I left off the "Enjoy!" and so ctweten's has gotten more votes than mine. ;)
This discussion has been so short and to the point, I thought I'd add a bit...
I dislike having to use the %{...} syntax as it is hard to read. One solution is:
But what we really need is a post-fix operator that give you the whole hash (or array, or scalar, etc.) from a reference:$ref= $obj->{param}; for( keys %$ref ) { Mung( $ref->{$_} ); }
This was proposed on perl5-porters a while back but noone has submitted a patch (as far as I know) to implement it. So here is your chance to become famous. Go to the perl5-porters archive and read up on the proposal and you've got a great project for learning Perl guts.my @keys= keys $obj->{param}->%;
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Postfix, whole-object dereference operators
by cwest (Friar) on Jul 21, 2000 at 18:03 UTC | |
RE: Postfix, whole-object dereference operators
by japhy (Canon) on Jul 21, 2000 at 19:11 UTC | |
by tye (Sage) on Jul 21, 2000 at 19:53 UTC | |
by cwest (Friar) on Jul 21, 2000 at 19:21 UTC | |
by japhy (Canon) on Jul 21, 2000 at 19:38 UTC | |
by japhy (Canon) on Jul 22, 2000 at 02:01 UTC |
In Section
Seekers of Perl Wisdom