in reply to Re: Change double quote to single quotes
in thread Change double quote to single quotes

The 2nd part
my($text2) = "test_\1_\2_\3";
is just to test if I could convert from double quoted string to single quoted string. I know how to avoid interpolation, but I dont know how to converted once its interpolated. Thanks for the help. -Paul

Replies are listed 'Best First'.
Re^3: Change double quote to single quotes
by dasgar (Priest) on Sep 02, 2010 at 19:42 UTC

    In my opinion, you need to find out where the interpolation is happening and then do something in your code and/or data entry to prevent the interpolation. Otherwise, you're trying to look a string, figure out if anything has been interpolated, find the interpolated characters, and then figure out how to undo/reverse the interpolation. That's a lot of guess work. Perhaps someone has figured out a good method for doing that, but that's above my level and skill knowledge to be able to do.

    I agree with JavaFan in that the interpolation is happening in the code. Meaning that your code either interpolates and then stored the interpolated string into the variable or your code interpolates the variable's content when you use it.

    If you can provide code for the widget (and the 'get' method in particular), perhaps someone can help identify where the interpolation is happening. If the interpolation is happening inside code from a module, then you might need to escape the backslashes (\\) in the data entry, which would interpolate into a single backslash.