c:\@Work\Perl\monks>perl -wMstrict -le "use Regexp::Common 'net'; ;; my $input = qq{ \n} . qq{} ; print qq{[[$input]] \n}; ;; my $want = qq{ \n} . qq{} ; ;; my $replacement_ip = '10.10.25.18'; ;; $input =~ s{ ) } {$replacement_ip}xmsg; ;; print $input eq $want ? 'Success:' : 'Failure:'; print qq{[[$input]]}; " [[ ]] Success: [[ ]]