pltcl and modules question

Поиск
Список
Период
Сортировка
Искать

pltcl and modules question

От:
hamann.w@t-online.de
Дата:

Hi,

is there any way to use a module within a pltcl script, i.e. have
load /path/to/mystuff.so
or
package require mystuff
in a script.
The reason why I am asking: I have recently converted a fairly slow script
(lots of regex) into one compiled module that basically does all regex at once, and critcl
made it fairly easy to build a .so or a tcl package out of the code
 
Similarly, would it be possible to access loaded module from perl script, i.e. have
use mystuff;
line

Regards
Wolfgang Hamann




Re: pltcl and modules question

От:
"Greg Sabino Mullane" <greg@turnstep.com>
Дата:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> is there any way to use a module within a pltcl script, i.e. have
> load /path/to/mystuff.so
> or
> package require mystuff
> in a script.

You can load tcl code by putting it in the pltcl_modules tables. See:

http://www.postgresql.org/docs/9.2/static/pltcl-unknown.html

> Similarly, would it be possible to access loaded module from perl 
> script, i.e. have
> use mystuff;

You can load any Perl module you want within a Pl/PerlU function.

It's possible to access shared code with Pl/Perl, but it's a little 
more involved. See:

http://www.postgresql.org/docs/9.2/static/plperl-under-the-hood.html

- -- 
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201303271036
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAlFTBHcACgkQvJuQZxSWSsiDogCdHga7xxBEVJFSEKlJqME+uo0o
pykAnicK1fLKZOJZMN2j1iEKQr4+AQMk
=b3/1
-----END PGP SIGNATURE-----



Re: pltcl and modules question

От:
hamann.w@t-online.de
Дата:


>> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: RIPEMD160
>> 
>> 
>> > is there any way to use a module within a pltcl script, i.e. have
>> > load /path/to/mystuff.so
>> > or
>> > package require mystuff
>> > in a script.
>> 
>> You can load tcl code by putting it in the pltcl_modules tables. See:
>> 
>> http://www.postgresql.org/docs/9.2/static/pltcl-unknown.html
>> 
>> > Similarly, would it be possible to access loaded module from perl 
>> > script, i.e. have
>> > use mystuff;
>> 
>> You can load any Perl module you want within a Pl/PerlU function.
>> 
>> It's possible to access shared code with Pl/Perl, but it's a little 
>> more involved. See:
>> 
>> http://www.postgresql.org/docs/9.2/static/plperl-under-the-hood.html
>> 
>> - -- 

Hi Greg,

thanks a lot, I will give it a try next week. Comparing the two references, I sort of fear
that there mght be a problem when tcl wants to load a binary rather than script module
I can try pgtclu as well....

Regards
Wolfgang Hamann


FAQ