perl -e '$f1=`cat file1`;open $f2,"<","file2";while(<$f2>){chomp;($k,$v)=split "_";$f1=~s/$k/${k}_$v/g;}print $f1;'