I think that should be:
$xml_content =~ s/<\?xml.*?\?>\n?//; # strip the <?xml blah?>
$xml_content =~ s/<!.*?>\n?//; # strip
.*? is non-greedy - if youre operating on a whole-file buffer this could
be important, but testing would tell you that youve deleted large chunks of your content.
<>! are not special inside a regex, and dont need escaped.
Byrne Reese <breese@...> wrote:
To package raw XML in a SOAP::Data element, simply:
my $xml_content = fetch($url);
$xml_content =~ s/\<\?xml.*\?\>\n?//; # strip the <?xml blah?>
$xml_content =~ s/\<\!.*\>\n?//; # strip
return SOAP::Data->type('xml' => $xml_content);
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.