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

You should be able to use Perl 6's given something like this:

for my $k (@required_fields) { given $href->{$k} { StripLTSpace($_); $_ or return DIRTY $row, "ERROR: required field $k not present +"; }; }
However, if you're worrying about this sort of thing for efficiency reasons something is seriously wrong somewhere ;-)

Replies are listed 'Best First'.
Re: Re: Will Perl 6 abbreviate this indirection for me?
by princepawn (Parson) on Sep 08, 2003 at 22:55 UTC
    Thanks for the reply.
    If you're worrying about this sort of thing for efficiency reasons something is seriously wrong somewhere
    Actually though, just imagine if each FETCH were tied to something compute intensive. Also, I am very serious about reducing redundancy in my code.

    Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality... download and use The Emacs Code Browser

      Actually though, just imagine if each FETCH were tied to something compute intensive.

      I can certainly imagine it - however I would still see it as a sign of something being seriously wrong.

      Creating a system where a computationally intensive operation became hidden behind an operation that is traditionally computationally cheap would be a design mistake in my book. It confounds expectations.

      The reduction in redundancy is a fair point, and I wouldn't want to argue with that being a fan of once and only once myself.