Check out example codes for "ternary operator perl". It will help you in understanding the concepts better.

Code Example 1

$hours > 40 ? get_overtime_wage($hours) : get_normal_wage($hours);

Learn ReactJs, React Native from akashmittal.com