#!/usr/bin/perl use strict; while(){ $_ =~ s/$ARGV[0]/$ARGV[1]/g; print $_; } __DATA__ |Chlre4|328957|pg._10_#_1 |Chlre4|28893|est.pg.C_80374 |Chlre5|338325|pm.pg._10_#_4