Received: from thor.advocast.com (advocast18.dsl.inconnect.com.76.140.209.in-addr.arpa [209.140.76.44] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB10jxF32823 for ; Thu, 30 Nov 2000 19:46:00 -0500 (EST) (envelope-from jellis@advocast.com) Received: from advocast83 (unknown [192.168.0.13]) by thor.advocast.com (Postfix) with SMTP id 2B64D80323 for ; Thu, 30 Nov 2000 21:10:14 -0700 (MST) Message-ID: <005301c05b30$be4318c0$0d00a8c0@dsl.inconnect.com> From: "Jonathan Ellis" To: References: <5.0.2.1.2.20001130113826.082b4ec0@pop.mindspring.com><3A268A5C.91CB7353@wgcr.org> <14886.40191.455322.734798@onceler.kciLink.com> <017c01c05b05$5729dfa0$0d00a8c0@dsl.inconnect.com> <26096.975625542@sss.pgh.pa.us> Subject: pltcl: missing close-brace Date: Thu, 30 Nov 2000 17:50:47 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200011/1019 X-Sequence-Number: 1165 I have a pl/tcl function that doesn't work, but the same function in a plain-vanilla tcl script does. (The function emulates Oracle's "replace" function.) The PL/TCL results: bf2=# create function replace2 (varchar, varchar, varchar) returns varchar as ' regsub -all {&} "$3" {\\\&} 3 regsub -all {\\[0-9]} "$3" {\\\0} 3 eval "regsub -all \{$2\} \{$1\} \{$3\} rval" return $rval ' language 'pltcl'; bf2'# bf2'# bf2'# bf2'# bf2'# CREATE bf2=# select replace2('a b', ' ', 'c'); ERROR: pltcl: missing close-brace The plain tcl results: #!/usr/bin/tcl proc replace { 1 2 3 } { regsub -all {&} "$3" {\\\&} 3 regsub -all {\\[0-9]} "$3" {\\\0} 3 eval "regsub -all \{$2\} \{$1\} \{$3\} rval" return $rval } puts [replace "a b" " " "c"] $ ./test.tcl acb Any idea what this error message means? -Jonathan