Is there a way to use "pack" in pl/perl without resorting to pl/perlu? - Mailing list pgsql-general

From Herouth Maoz
Subject Is there a way to use "pack" in pl/perl without resorting to pl/perlu?
Date
Msg-id CCE2C667-156E-4FEC-912F-6454ABADB054@unicell.co.il
Whole thread Raw
Responses Re: Is there a way to use "pack" in pl/perl without resorting to pl/perlu?
List pgsql-general
I created a function that does some heavy string manipulation, so I needed to use pl/perl rather than pl/pgsql.

I'm not experienced in perl, but the function works well when used as an independent perl subroutine - it depends only
onits arguments. I use the Encode package (in postgresql configuration). 

But my use of the "pack" function causes a Safe error. Apparently "pack" and "unpack" are in the operator mask.

Is there any way to remove them from that mask? I don't want to use pl/perlu - it's too unsafe, I think, and its
runningenvironment is different. I just want these two operators. 

This is what I'm using "pack" for: I convert a string in the format '43414C4C5F494445' into a binary string, and then,
givena matching text encoding, use "decode" to convert it to proper unicode. 


TIA,
Herouth

pgsql-general by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Compressed binary field
Next
From: Tom Lane
Date:
Subject: Re: CentOS initd Script