Other forms of the if statement
Comparison Operators
Ternary Operatorexamples/scalars/ternary.p6 use v6;
my $age = 42;
if $age > 18 {
say "Above 18";
} else {
say "Below 18";
}
say $age > 18 ?? "Above 18" !! "Below 18";
COND ?? VALUE_IF_TRUE !! VALUE_IF_FALSE Copyright 2006, 2007, 2008, 2009, 2010 Gabor Szabo http://szabgab.com/ Index | TOC |