if statement - comparing values



You can compare two values or scalar variables using the 
if
 
statement and one of the comparison operators.
examples/scalars/if.p6
#!/usr/bin/perl6
use v6;

my $age = 23;
if ($age > 18) {
   say "You can vote in most countries.";
}


Copyright 2006, 2007, 2008, 2009, 2010 Gabor Szabo http://szabgab.com/ Index | TOC
If you are interested in on-site trainings by the author, please contact me directly.

Online courses: