in reply to Passing by Named Parameter

I'm still reasonably happy with the strategy in Re (tilly) 2: passing subroutine arguments directly into a hash.

YMMV though.

Replies are listed 'Best First'.
Re: Re: Passing by Named Parameter
by John M. Dlugosz (Monsignor) on Jan 27, 2004 at 16:30 UTC
    That's what I did the other day when I only needed one function. That is, I removed each arg when using it and then if there's anything left it's an error. I wished for the Perl6 // operator, but by checking for an undef value rather than definedness in the hash, I only mentioned the actual key once and so didn't bother making it a helper function.

    I think I'll use your function (or one like it) next time I want simple argument naming. Thanks.