Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j9RoL-0005md-OD for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 11:03:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9RoJ-0003xk-Nc for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 11:03:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9RoJ-0003xc-AA for pgsql-general@lists.postgresql.org; Wed, 04 Mar 2020 11:03:31 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j9RoC-00024P-9u for pgsql-general@lists.postgresql.org; Wed, 04 Mar 2020 11:03:29 +0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 48XWFl1pjxz1Gyh for ; Wed, 4 Mar 2020 06:03:23 -0500 (EST) Received: by panix5.panix.com (Postfix, from userid 17622) id 48XWFl0XXRzfYm; Wed, 4 Mar 2020 06:03:23 -0500 (EST) Date: Wed, 4 Mar 2020 06:03:22 -0500 From: stan To: pgsql-general@lists.postgresql.org Subject: Use of perl modules in plperl ? Message-ID: <20200304110322.GA4887@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I am trying to examine the values of $_TD->{new}. I thought the easiest way to see what this structure looked like was to use the Dumper functionality. To do so I need to include the appropriate Perl module, which I would think would be done like this: use Data::Dumper qw(Dumper); But inserting that into the script to create the function, like this: CREATE OR REPLACE FUNCTION valid_id() RETURNS trigger AS $$ use Data::Dumper qw(Dumper); if (($_TD->{new}{i} >= 100) || ($_TD->{new}{i} <= 0)) { ...... Returned this error message: ERROR: Unable to load Data/Dumper.pm into plperl at line 2. BEGIN failed--compilation aborted at line 2. CONTEXT: compilation of PL/Perl function "valid_id" What do I have to do to use Perl modules in plperl function/ BTW this works outside plperl #!/usr/bin/perl use strict; use warnings; use Data::Dumper qw(Dumper); .................. Thanks for the help. -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin