Skip to content

Instantly share code, notes, and snippets.

@gfldex
Created March 27, 2021 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gfldex/96fad87c7bcb1c03c5584c37612aae91 to your computer and use it in GitHub Desktop.
Save gfldex/96fad87c7bcb1c03c5584c37612aae91 to your computer and use it in GitHub Desktop.
use v6.d;
multi sub _when(Int $i) { dd $i; }
multi sub _when($_ where $_ ~~ /(\w+)/) { say $0 }
given 42 {
$_.&_when;
}
given 'word' {
$_.&_when;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment