|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
resolved: Shorter than ternary?by Spidy (Chaplain) |
| on Nov 15, 2007 at 21:04 UTC ( #651075=perlquestion: print w/ replies, xml ) | 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? Thanks, Spidy Edit: I ended up just hacking a piece of HTML::Template to suit my needs:
And then it's called using:
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||