Re: pl/perl and recent perl versions - failing to load internal modules - Mailing list pgsql-general

From Alex Hunsaker
Subject Re: pl/perl and recent perl versions - failing to load internal modules
Date
Msg-id CAFaPBrSvM_hsNVWRezucJMCCaJzAQg2f-TfzYh8VacihqrgFHQ@mail.gmail.com
Whole thread Raw
In response to Re: pl/perl and recent perl versions - failing to load internal modules  (Toby Corkindale <toby.corkindale@strategicdata.com.au>)
Responses Re: pl/perl and recent perl versions - failing to load internal modules  (Alex Hunsaker <badalex@gmail.com>)
List pgsql-general
On Tue, Jul 1, 2014 at 6:39 PM, Toby Corkindale
<toby.corkindale@strategicdata.com.au> wrote:
> Hi Alex,
> your example (chr(0x100) =~ /\\xa9/) works on my instance (pg 9.3.4, plperl 5.18)
> However the following code fails:
> =>  do $$ "\N{U+263A}" =~ /[[:punct:]]/$$ language plperl;
> ERROR:  Unable to load utf8.pm into plperl at line 1.
> BEGIN failed--compilation aborted.
> CONTEXT:  PL/Perl anonymous code block
>
> Oddly, even if I add utf8 to plperl.oninit, I then get an error about being unable to load the 're' (regex) module. I
don'tunderstand how the example you gave does manage to work! 

Strange, seems to works for me with 5.20:
=> do $$ "\N{U+263A}" =~ /[[:punct:]]/$$ language plperl;
DO
Time: 12.928 ms

=> show plperl.on_init;
 plperl.on_init
────────────────

(1 row)

Time: 0.786 ms

=> show plperl.on_plperl_init;
 plperl.on_plperl_init
───────────────────────

(1 row)


One thing you might try is plperl.on_plperl_init = "require
'utf8_heavy.pl'; require unicore/Heavy.pl'; or maybe just
plperl.on_plperl_init = 'use Unicode::UCD;'

If that still fails, You might find the attached useful, it tires to
preload all the unicore files. You should be able to stick it
somewhere and plperl.on_plperl_init = '/path/to/unicore_preload.pm'.
However, hopefully one of the first suggestions will work..

Attachment

pgsql-general by date:

Previous
From: Toby Corkindale
Date:
Subject: Re: Two-way encryption
Next
From: Alex Hunsaker
Date:
Subject: Re: pl/perl and recent perl versions - failing to load internal modules