perl ternary assign variable code example Example: ternary operator perl $hours > 40 ? get_overtime_wage($hours) : get_normal_wage($hours);