Skip to content

Instantly share code, notes, and snippets.

@dwarring
Last active August 29, 2015 14:03
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 dwarring/13cdf1f047b3e085f4c2 to your computer and use it in GitHub Desktop.
Save dwarring/13cdf1f047b3e085f4c2 to your computer and use it in GitHub Desktop.
sub foo {say 'outer foo'}
sub infix:<bar>($a,$b) {say "outer bar {$a + $b}" }
sub infix:<baz>($a,$b) {say "outer baz {$a * $b}" }
foo();
2 bar 3;
2 baz 3;
say;
{
sub foo { say 'inner foo' }
sub infix:<bar>($a,$b) {say "inner bar {$a + $b}" }
sub infix:<baz>($a,$b) is tighter(&infix:<*>) {say "inner baz {$a * $b}" }
foo();
2 bar 3;
2 baz 3;
say;
}
foo();
2 bar 3;
2 baz 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment