daily pastebin goal
89%
SHARE
TWEET

[Perl 6] Using return statement.

cwchen Nov 15th, 2017 100 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top