deleting lines between patterns using sed or awk

hi,
Here is excerpt from my xml file

<!-- The custom module to do the authentication for LDAP
                  -->

</login-module>
                        <login-module code="com.nlayers.seneca.security.LdapLogin" flag="sufficient">
                <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
                <module-option name="java.naming.provider.url">ldap://ip/</module-option>
                <module-option name="java.naming.security.authentication">simple</module-option>
                <module-option name="principalDNPrefix">cn=</module-option>
                                <module-option name="principalDNSuffix">,cn=Users,dc=X,dc=Y</module-option>
                                <module-option name="allowEmptyPasswords">false</module-option>
            </login-module>
                </authentication>

Please can some one tell me how can i delete all the lines between the text <!-- The custom module to do the authentication for LDAP
--> and </authentication>

Thanks.

perl -p0e 's/<!-- The custom module to do the authentication for LDAP.*<\/authentication>\n//s' file.xml
1 Like