Skip to content

Instantly share code, notes, and snippets.

@swuecho
Created August 13, 2012 19:06
Show Gist options
  • Select an option

  • Save swuecho/3343306 to your computer and use it in GitHub Desktop.

Select an option

Save swuecho/3343306 to your computer and use it in GitHub Desktop.
whileif;
sub whileif {
my @a = 0..9;
my $i = 0;
while $i < 10 {
my $a=@a[$i];
say $a;
if $a < 1 {
say "less than 1";
} elsif $a > 1 { # error from rakudo: missing block here. but if I change the last two branches, everything is ok.
say "greater than 1";
} else {
say "equal 1";
}
$i++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment