Mega Code Archive

 
Categories / Perl / Statement
 

The if Construct

print "How old are you? "; chomp($age = <STDIN>); if ($age >= 21 ){  # If true, enter the block     print "Let's party!\n"; } print "You said you were $age.\n";