in reply to Will Perl 6 abbreviate this indirection for me?

Unless StripLTSpace() is actually using a prototype to get a reference to $href->{$k} (update: which it then modifies), or the values of the hash may be large, you could probably just make a copy of the value:

for my $k (@required_fields) { my $v = $href->{$k}; StripLTSpace($v); $v or return DIRTY $row, "ERROR: required field $k not present"; }

If you don't want to make a copy, you can use for's aliasing ability, like so:

for my $k (@required_fields) { for my $v ($href->{$k}) { StripLTSpace($v); $v or return DIRTY $row, "ERROR: required field $k not present"; } }

IIRC, the syntax for Perl6 for loops will include the ability to have multiple iterator variables, something similar to:

for my $k, $v (...) {

But I'm not sure how you'd write the ... part. The only thing I can think of now is something involving map that's likely to be more expensive than just creating a copy of the value. *shrug*

Update: Another way to do it:

for my $k (@required_fields) { my $vr = \$href->{$k}; StripLTSpace($$vr); $$vr or return DIRTY $row, "ERROR: required field $k not present"; }

Thinking about it further, however, I find it a bit unlikely that doing two hash look-ups rather than one is actually profiling as a bottleneck in your program. Unless there are extenuating circumstances that you haven't detailed, perhaps you should profile the program to determine exactly where the bottlenecks are occuring.

bbfu
Black flowers blossom
Fearless on my breath