#!/usr/bin/perl -w use strict; my $verbose = (@ARGV && $ARGV[0] eq '-v' && shift); my %change = (); while (){ chomp; my ($in,$out) = split /\s*=>\s*/; next unless $in && $out ; $change{$in} = $out; } if (@ARGV){ $^I = ".orig"; } else{ warn "$0: Reading from stdin\n" if -t STDIN; } while (<>){ my $i = 0; s/^(\s)// && print $1; for (split /(\s+)/,$_,-1){ print( ($i++ & 1) ? $_ : ($change{$_} || $_)) } } __END__ turnkey => turn-key