in reply to regex incorrectly matching newline

Hi,

I see a problem in your IF statement. Try this out:

$i="hello\nworld";
if ($i =~ s/[^ -~]/./g)
    {
    $rhs .= $i;
    }
    else
    {
    $rhs .= ".";
    }
print $rhs;

Sriram