Skip to content

Instantly share code, notes, and snippets.

@brianphillips
Created December 10, 2012 20:53
Show Gist options
  • Save brianphillips/4253309 to your computer and use it in GitHub Desktop.
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