in reply to passing subroutine args as a hash: why not?
I'm wondering why more people don't call subroutines with a single hash as the argument.
Most people don't write subroutines that take 61 arguments! :-) I've gotta wonder what that subroutine is doing, and whether it may be better to break it up into several subroutines that each do something small and specific.
That said, when you do have a fairly large number of subroutine arguments, I think passing them as named parameters in a hash is a fine idea, for the reasons you mentioned.
-- Mike
--
just,my${.02}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: passing subroutine args as a hash: why not?
by hardburn (Abbot) on Jun 05, 2003 at 18:23 UTC | |
by djantzen (Priest) on Jun 05, 2003 at 18:51 UTC | |
by hardburn (Abbot) on Jun 06, 2003 at 13:41 UTC | |
by djantzen (Priest) on Jun 06, 2003 at 15:33 UTC | |
|
Re: Re: passing subroutine args as a hash: why not?
by Willard B. Trophy (Hermit) on Jun 05, 2003 at 18:58 UTC | |
by sauoq (Abbot) on Jun 05, 2003 at 20:12 UTC | |
by Willard B. Trophy (Hermit) on Jun 05, 2003 at 21:37 UTC |