Skip to content

Instantly share code, notes, and snippets.

@moritz
Created January 26, 2012 17:58
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 moritz/1684048 to your computer and use it in GitHub Desktop.
Save moritz/1684048 to your computer and use it in GitHub Desktop.
parrot link substitution
use strict;
use warnings;
use autodie;
use 5.010;
open my $f, '<', '../issue-map';
my %map;
while (<$f>) {
chomp;
my @a = split;
s/\D+//g for @a;
$map{$a[1]} = $a[0];
}
BEGIN {$^I = ''}
my $keys = join '|', keys %map;
while (<>) {
s[https?://trac\.parrot\.org/parrot/ticket/($keys)\b][https://github.com/parrot/parrot/issues/$map{$1}]g;
print;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment