I have to substitute ” or ” with single quotes. Now the output I get from the above code is ” ' 3&'” Where the expected output should be ‘3’.Code:#!/usr/bin/perl $line="” 3”"; $line =~ s/[&|&\;]rdquo;/'/g; print $line;
| SitePoint Sponsor |


I have to substitute ” or ” with single quotes. Now the output I get from the above code is ” ' 3&'” Where the expected output should be ‘3’.Code:#!/usr/bin/perl $line="” 3”"; $line =~ s/[&|&\;]rdquo;/'/g; print $line;
maybe this will meet your requirements:
Code:$line="” 3”"; $line =~ s/&(amp;)?rdquo;/'/g; print $line;
Bookmarks