hello list
i know theres more than one way to do it, but i would like a cleaner way.
im trying to globally replace singlesqoutes with doubleqoutes and vice
versa and the script below does seem to work but its rather an akward
way to do it. is there a solution to do this without using those kinds
of placeholders?
thanks
allan
#!/usr/bin/perl -w
my $str = qq(this word should have 'doubleqoutes' and this should have "singleqoutes");
$str =~ s/'/some_temp_for_singles/g;
$str =~ s/\"/some_temp_for_doubles/g;
$str =~ s/some_temp_for_singles/"/g;
$str =~ s/some_temp_for_doubles/'/g;
print "OK: ", $str;
#this approach would not be OK:
#$str =~ s/'/"/g;
#$str =~ s/"/'/g;