Just use:
Note that no parentheses of any sort are necessary.$ref = $hash_count ? \%hash : $array_count ? \@array : $ref_to_all_lines_in_file;
In reply to Re: Nested Ternary Operators
by Dominus
in thread Nested Ternary Operators
by reyjrar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |