I believe that this is taking TIMTOWDI a bit too far.
The most common form I have seen is a list of key-value pairs as the argument list. Using a hashref is generally done only in functions that have been retrofitted to accept keyword options where a hashref was previously forbidden in the argument list.
sub my_func { my %params = @_; print "Message received: " . $params->{message}; if ($params->{newline}) { print "\n" } }
In reply to Re: Thoughts on "one function, flexible arguments"?
by jcb
in thread Thoughts on "one function, flexible arguments"?
by hornpipe2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |