chinese francais restaurant restaurant chinese restaurant restaurant francais #### #read file in hash my %dictionary; while () { my ( $key, $tgt ) = split(/\t/, $_); push @{ $dictionary{$key} }, $tgt; } #apply dic to txt file while () { my $line = $_; foreach my $key (keys %dictionary) { #$line =~ s/%$src%/$dictionary{$key}/g; } print $line; }