foreach (@SUB_REC) { $yourText =~ s/$_->[0]/$_->[1]/g; }