in reply to Nested Ternary Operators
Just use:
$ref = $hash_count ? \%hash : $array_count ? \@array : $ref_to_all_lines_in_file; [download]