P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
G'day SamCG, A small, representative example of data, together with a short, self-contained script that reproduces what you're attempting to achieve, would go a long way to getting a better answer. If terms such as "parties", "transactional roles", "production values", and so on, are important in understanding your problem domain, please provide appropriate descriptions. "... but I still think it could be improved" Here's some suggestions for improvement (particularly with respect to readability and maintainability). Using statements, as opposed to simple values, for the ternary operators's 2nd and 3rd operands, leads to all sorts of problems (often related to precedence), reduces readability, and increases the difficulty of maintenance: all of this leads to error-prone code. See the documentation (link provided) for examples. This
would probably be better as
And this
would definitely be better as
"Does the code below work?" I don't really know what you're asking. Short answer: run it and find out for yourself. Longer answer: explain what it's supposed to do and why the "Short answer" is inadequate. "And if so, can I really insert it the way I did into the trinary operator above?" As already explained, even attempting to do so is not a good idea. -- Ken In reply to Re: Iterating over second key in HoH defined by reference
by kcott
|
|