in reply to Using Shift with Parameters in a subroutine
It would only seem rational that we have a way to [condense argument passing], especially if i am passing 10 references to my subroutine. … I see there is no formal parameter support, at least in perl 5.10.1 (which is my customer version).
The Perl Best Practice titled "Named Arguments" applies in the case you describe: "Use a hash of named arguments for any subroutine that has more than three parameters."
This Best Practice is in Chapter 9, Subroutines, which is available online here: http://oreilly.com/catalog/perlbp/chapter/ch09.pdf. "Named Arguments" is on pp. 182-3.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using Shift with Parameters in a subroutine
by perlron (Pilgrim) on Oct 21, 2014 at 17:30 UTC |
In Section
Seekers of Perl Wisdom