|laziness, impatience, and hubris|
resolved: Shorter than ternary?by Spidy (Chaplain)
|on Nov 15, 2007 at 21:04 UTC||Need Help??|
Spidy has asked for the
wisdom of the Perl Monks concerning the following question:
Greetings, fellow monks.
I have a module I'm working on that accepts a hash of arguments to one of its functions. If no hash is supplied, it fills in the arguments itself. This is the code I am using:
However, there are a lot of defaults I need to do this for. Is there any way to write this in a shorter form and have it work?
Edit: I ended up just hacking a piece of HTML::Template to suit my needs:
And then it's called using: