while (){ s/^Port.+/Port $sshport/i; s/^#Port\s.+/Port $sshport/i; print SSHD_CONFIG_NEW $_; }