http://qs321.pair.com?node_id=1104465


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.

  • Comment on Re: Using Shift with Parameters in a subroutine

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
    thanks Jim. that's definitely a case in point then.