X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 72D5C3A3F18 for ; Sun, 23 Jan 2005 18:59:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21629-07 for ; Sun, 23 Jan 2005 18:59:04 +0000 (GMT) Received: from jalapeno.crazydogs.org (jalapeno.jellybean.co.uk [212.78.70.100]) by svr1.postgresql.org (Postfix) with ESMTP id 25CB63A4C9D for ; Sun, 23 Jan 2005 18:59:02 +0000 (GMT) Received: from rp by jalapeno.crazydogs.org with local (Exim 3.36 #1 (Debian)) id 1Csmwu-00085N-00; Sun, 23 Jan 2005 18:59:00 +0000 Date: Sun, 23 Jan 2005 18:59:00 +0000 From: Richard Poole To: pgsql-admin@postgresql.org Cc: "Haron, Charles" Subject: Re: Trouble Escaping Quotes Message-ID: <20050123185859.GB2498@guests.deus.net> References: <593E515C9586D511BB4500010283D5E2025649A9@COG-MAIL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <593E515C9586D511BB4500010283D5E2025649A9@COG-MAIL> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.296 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/239 X-Sequence-Number: 16098 On Fri, Jan 21, 2005 at 08:43:00AM -0700, Haron, Charles wrote: > Yes, but how do you escape the quote when the value of the string isn't know > until the function is run? > > If $rma_data->{\'company_name\'} is returning Bob's Fixit at run time, how > do escape the quote BEFORE Perl interprets the string and generates an > error? Your quote-escaping looks fine to me; \' is just as good as '', although less standard. I can't reproduce your problem here; your function works for me under 8.0.0 and perl 5.8.6 . What's your error message when you call it? Are you sure that your problem isn't happening earlier, when you put the data into the database in the first place? Richard