Try this, and remember - with XML there are more than one you have to
change:
sub xc {
#returns text free of XML baddies - xc = xml clean
my $data = $_[0];
$data =~ s/&/&/g;
$data =~ s/</</g;
$data =~ s/>/>/g;
$data =~ s/'/'/g;
$data =~ s/"/"/g;
return $data;
}
-----Original Message-----
From: John [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 03, 2005 9:36 AM
To: Perl Beginners
Subject: replacing special chars
Hello to all
I want to replace the & with the &
I use the command s/\&/\&/; with no luck
Does anybody know what am i missing here?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>