Skip to content

Instantly share code, notes, and snippets.

@peschwa
Created October 2, 2014 10:24
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 peschwa/ca9e9451d9da19f29c73 to your computer and use it in GitHub Desktop.
Save peschwa/ca9e9451d9da19f29c73 to your computer and use it in GitHub Desktop.
use v6;
my $match;
my $call = { say "in call: " ~ $0 };
sub set-match {
"abc" ~~ /(.)/;
$match = $/;
}
sub get-match {
$/ := $match;
say "in get-match: $/";
$call();
}
set-match;
say "match: " ~ $match;
get-match;
say "match: " ~ $match;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment