Mar 31, 2005 #1 cgiles82 MIS Mar 31, 2005 3 US foreach ($title) { $_=~s/\&/&/g; $_=~s/\"/"/g; $_=~s/\'/'/g; } The script replace any " in the title with " but then the script replaces the & with &. Is there a work around?
foreach ($title) { $_=~s/\&/&/g; $_=~s/\"/"/g; $_=~s/\'/'/g; } The script replace any " in the title with " but then the script replaces the & with &. Is there a work around?
Mar 31, 2005 1 #2 ChewDoggie Programmer Mar 14, 2005 604 US try this: $_ =~ s/\&([^\#])/\&$1/g; $_ =~ s/\"/"/g; $_ =~ s/\'/'/g; See if that works. AMA Upvote 0 Downvote
Mar 31, 2005 #3 KevinADC Technical User Jan 21, 2005 5,070 US well the code as posted is a bit odd: foreach ($title) normally you don't loop through a single scalar like that. This should work fine: $title =~s/\&/&/g; $title =~s/\"/"/g; $title =~s/\'/'/g; the order of the substitutions is the trick, and the above order should work fine. Upvote 0 Downvote
well the code as posted is a bit odd: foreach ($title) normally you don't loop through a single scalar like that. This should work fine: $title =~s/\&/&/g; $title =~s/\"/"/g; $title =~s/\'/'/g; the order of the substitutions is the trick, and the above order should work fine.