Skip to content

Instantly share code, notes, and snippets.

@brianphillips
Created December 10, 2012 20:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save brianphillips/4253309 to your computer and use it in GitHub Desktop.
Testing search/replace in a loop
my $value = "/a/b/:c/d/:e";
my %values = (c => 1, d => 2, e=>3);
for %values.kv -> $k, $v {
if $value ~~ s/\:$k/$v/ {
say "Matched! $k against $value: (match was $/)";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment