This function replaces some XML tag values. The tags appear in the XML exactly once.I want to know if this can be done in a better way.sub editConnConfig{my ($DOMAIN,$rscDir,$walletDir,$DEFAULTPORT)=@_;`perl -pi -e 's!<trustStore>.*?</trustStore>!<trustStore>$walletDir/fctrust.jks</trustStore>!sg' $rscDir/ConnectionConfig.xml 2>&1`;`perl -pi -e 's!<keyStore>.*?</keyStore>!<keyStore>$walletDir/fckey.jks</keyStore>!sg' $rscDir/ConnectionConfig.xml`;`perl -pi -e 's!<keyStorePassword>.*?</keyStorePassword>!<keyStorePassword>jkspass1</keyStorePassword>!sg' $rscDir/ConnectionConfig.xml`;`perl -pi -e 's!<directoryName>.*?</directoryName>!<directoryName>$DOMAIN</directoryName>!sg' $rscDir/ConnectionConfig.xml`;`perl -pi -e 's!<dbDaemonPort>.*?</dbDaemonPort>!<dbDaemonPort>$DEFAULTPORT</dbDaemonPort>!sg' $rscDir/ConnectionConfig.xml`;}
Replacing XML tag values
perl