Are you asking conditional operator in PERL?

like the following example:

Conditional Operator
Syntax:
Code:
 Condition   ? Then : Else