in reply to Re: finding and replacing
in thread finding and replacing

Hi, In my case, this works for only the first " ' ", not all. If there are two or more " ' ", the program doesn't work. Can anyone explain why?

Replies are listed 'Best First'.
Re^3: finding and replacing
by NetWallah (Canon) on Dec 05, 2005 at 05:12 UTC
    You need to post your code for us to be able to help you.

    Simply saying it does not do what you expect does not help - we need to know what "it" is before we can help.

    Update: - I'm guessing what you mean is that if a particular array element contains more than one single-quote, only the first single-quote gets escaped/replaced, in the code I posted.

    This is correct. If you need all of them replaced, use the "g" option in the regular expression .

    s/'/\\'/g for @a;

         You're just jealous cause the voices are only talking to me.

         No trees were killed in the sending of this message.    However, a large number of electrons were terribly inconvenienced.