I am using XML::Simple in one of my perl scripts to extract some messages, problem is I am getting this error :
No semi-colon found after entity name [Ln: 1, Col: 151]
when I use XMLin( $msg )
and $msg
contains an invalid character like '&'
I know I can use regex to remove them, but I don't want to. I can use replace & with &
.
Is there a simple way in perl to deal with this kind of invalid characters in strings when I use XMLin( $msg )
?
Example for $msg
can be like : <Error>Exception Invalid address (&F5F5F5F5)</Error>