#!/usr/bin/perl use strict; my $find = '()'; my $rplc = '$1\n mdp.travel.co.uk\n'; open( IN, "<", "/tmp/ls.conf" ) or die "/tmp/ls.conf: $!"; $/ = undef; $_ = ; eval "s{$find}{$rplc}"; open( OUT, ">", "/tmp/ls.conf.new" ) or die "/tmp/ls.conf.new: $!"; print OUT;