It is no secret that one of Perls strong points is its robust built in support for regular expressions. If you are not familiar with regular expressions, here is an excellent tutorial site for starters. The following two lines of Perl will remove CData start and end tags from an xml string. As always in Perl there is more than one way to do it, and if any one has a suggestion to improve this code snippet please post a comment or send an email through the contact page.
Assuming you have a scalar named $xml that contains your xml string with CData tags inside:
$xml =~ s/<!\[CDATA\[//g; $xml =~ s/\]\]>//g;
|