X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D9A2DD1B1BE for ; Thu, 22 Jul 2004 15:23:03 -0300 (ADT) 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 81351-05 for ; Thu, 22 Jul 2004 18:22:50 +0000 (GMT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 82715D1B17B for ; Thu, 22 Jul 2004 15:22:49 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 1996562; Thu, 22 Jul 2004 11:14:44 -0700 Message-ID: <410005F7.2040109@joeconway.com> Date: Thu, 22 Jul 2004 11:22:47 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: devin@synapticvision.com Cc: pgsql-sql@postgresql.org Subject: Re: Converting a plperlu function to a plpgsql function References: <1090507793.7474.27.camel@192.168.1.80> In-Reply-To: <1090507793.7474.27.camel@192.168.1.80> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/187 X-Sequence-Number: 18439 Devin Whalen wrote: > First line: > my @active_tables=split(/,/,$tables); > > Is there anyway to split a variable like the perl split above? I'm no perl guru, but in 7.4 I believe this does what you're looking for: regression=# select string_to_array('1,2,3',','); string_to_array ----------------- {1,2,3} (1 row) > Second line: > > if ($r=~/^-([0-9]?)([A-z_]+)/) > { > my $locid = $1; > my $table = $2; Not sure about this one. Hopefully someone else can chime in. Maybe a little less efficient, but it seems like it would be easy enough to parse when true. HTH, Joe