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}->%;
In reply to Postfix, whole-object dereference operators
by tye
in thread keys function question
by raflach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |