Advertisement
cwchen

[Perl 6] Using return statement.

Nov 15th, 2017
1,211
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement