Hi folks I need help for changing a password in an XML file like this:


This is my XML file

<Listens> <Listen name="SynchronousSSL"> <param name="Address" value="BLABLA1 /> <param name="Port" value="BLABLA2" /> <param name="ServerSocket" value="BLABLA3" /> <param name="SSLFlag" value="true" /> <param name="SSLTrustStoreFileName" value="BLABLA4" /> <param name="SSLTrustStorePassword" value="BLABLA5"/> <param name="SSLTrustStoreType" value="JKS" /> <param name="SSLKeyStoreFileName" value="BLABLA6" /> <param name="SSLKeyStorePassword" value="BLABLA7"/> <param name="SSLKeyStoreType" value="pkcs12" /> <param name="SSLClientCertificateMandatory" value="true" /> <param name="SSLDebug" value="false" /> </Listen>


and I wanted to change SSLKeyStorePassword with a new value "BLABLA8" for exemple.


So i will have

<Listens> <Listen name="SynchronousSSL"> <param name="Address" value="BLABLA1 /> <param name="Port" value="BLABLA2" /> <param name="ServerSocket" value="BLABLA3" /> <param name="SSLFlag" value="true" /> <param name="SSLTrustStoreFileName" value="BLABLA4" /> <param name="SSLTrustStorePassword" value="BLABLA5"/> <param name="SSLTrustStoreType" value="JKS" /> <param name="SSLKeyStoreFileName" value="BLABLA6" /> <param name="SSLKeyStorePassword" value="BLABLA8"/> <param name="SSLKeyStoreType" value="pkcs12" /> <param name="SSLClientCertificateMandatory" value="true" /> <param name="SSLDebug" value="false" /> </Listen>


How can i do this in perl?


Many thanks for the reply.

Discipulus added code tags


In reply to XML replace password with a specific tag by Bluesaka75

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.