#!/usr/local/bin/perl

# $Id: subst,v 1.2 1998/11/07 23:45:55 czyborra Exp $

$table = shift || die "Usage: $0 <tablefile>\n";
open (TABLE, $table) || die "Couldn't open $table: $!\n";

while (<TABLE>)
{
	$mapping{$1} = $2 if /(.*)\t(.*)/;
}

$pattern = join ('|', keys %mapping);

while (<>)
{
	print if s/$pattern/$mapping{$&}/go;
}
