Advertisement
cwchen

[Perl 6] Using return statement.

Nov 15th, 2017
2,396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.13 KB | None | 0 0
  1. sub is-odd(Int $n) {
  2.     if $n % 2 == 0 {
  3.         return False;
  4.     }
  5.    
  6.     True;
  7. }
  8.  
  9. is-odd(3) or die "Wrong status";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement