Skip to content

Instantly share code, notes, and snippets.

@peterkeen
Created September 30, 2010 23:34
Show Gist options
  • Save peterkeen/605504 to your computer and use it in GitHub Desktop.
Save peterkeen/605504 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/perl58 -w
use strict;
my @replacements = qw/
alter
table
add
column
integer
constraint
foreign
key
references
deferrable
create
index
on
/;
my %reps = map { $_ => uc $_ } @replacements;
while(<>) {
s{\b(\w+)\b}{ $reps{$1} ? $reps{$1} : $1 }xge;
print $_;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment