Conditional Operators and print statement : Conditional Operators « Language Basics « Perl






Conditional Operators and print statement

   

print "What was your grade? ";
$grade = <STDIN>;
print $grade > 60 ? "Passed.\n" : "Failed.\n";

   
    
    
  








Related examples in the same category

1.Conditional Operator: (condition) ? statement_if_true : statement_if_false;
2.? operator