Perl Newbie here and feeling rather stupid but hoping someone can help me. All I'm trying to do is specify each value within a hash based on some test using conditional code. e.g.
<code> %Weather = ( 'precipitation' => if ($rain == 0) 'dry' Elseif ($rain == 1) 'wet' )I know I should be able to use the ternary ? as well, but is this just not possible within a hash?
In reply to Conditional within Hash definition by veryan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |