programming-examples/perl/Statement/if scope.pl

10 lines
152 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl
use strict;
use warnings;
if ( (my $toss=rand) > 0.5 ) {
print "Heads ($toss)\n";
} else {
print "Tails ($toss)\n";
}