daily pastebin goal
64%
SHARE
TWEET

[Perl 6] Using return statement.

cwchen Nov 15th, 2017 96 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";
RAW Paste Data
Top