Advertisement
cwchen

[Perl 6] bitwise operators

Sep 30th, 2017
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.21 KB | None | 0 0
  1. constant $READ = 4;
  2. constant $WRITE = 2;
  3. constant $EXEC = 1;
  4.  
  5. $READ +^ $WRITE == 6 or die "Wrong priviledge";
  6. $READ +^ $EXEC == 5 or die "Wrong priviledge";
  7. $READ +^ $WRITE +^ $EXEC == 7 or die "Wrong priviledge";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement