Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Advantages to passing a hash to a subroutine?

by eyepopslikeamosquito (Chancellor)
on Jun 19, 2012 at 08:20 UTC ( #976979=note: print w/ replies, xml ) Need Help??


in reply to Advantages to passing a hash to a subroutine?

The reasons behind why to use a hash of named arguments as a subroutine parameter is discussed in Perl Best Practices, Chapter 9, "Use a hash of named arguments for any subroutine that has more than three parameters". Luckily, Chapter 9 happens to be the free sample chapter from this book.

  • Comment on Re: Advantages to passing a hash to a subroutine?

Replies are listed 'Best First'.
Re^2: Advantages to passing a hash to a subroutine?
by alliswell (Novice) on Jun 22, 2012 at 15:00 UTC
    Yes, thanks for pointing out the free PDF. Perfect!

    In Perl Best Practices, they state using "Named arguments replace the need to remember any ordering..Especially if you have, or are likely to have more than three arguments."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976979]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2016-06-27 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (335 votes). Check out past polls.