Advertisement
cwchen

[Perl 6] proceed and succeed

Oct 5th, 2017
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.39 KB | None | 0 0
  1. my $w = Date.today.day-of-week;
  2.  
  3. given $w {
  4.     when 1 {
  5.         proceed;
  6.     }
  7.     when 2 {
  8.         proceed;
  9.     }
  10.     when 4 {
  11.         "Week".say;
  12.     }
  13.     when 3 {
  14.         "Hump day".say;
  15.     }
  16.     when 5 {
  17.         "Thank God It's Friday".say;
  18.     }
  19.     when 6 {
  20.         proceed;
  21.     }
  22.     when 7 {
  23.         "Weekend".say;
  24.     }
  25.     default {
  26.     die "Unknown day";
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement