programming-examples/perl/Statement/if-else statement.pl
2019-11-15 12:59:38 +01:00

14 lines
223 B
Perl

#if ( expression ){
# statements;
#else{
# statements;
#}
$coin = int (rand(2 )) + 1; # Generate a random number between 1 and 2
if( $coin == 1 ) {
print "HEAD\n";
}
else {
print "TAIL\n";
}