GTM - Perl extension for accessing GT.M
use GTM ":all"; use GTM qw(:sysvar :global :trans);
embed GT.M within Perl
The GTM module embeds GT.M in Perl. This module provides the low-level Interface to the GT.M database environment.
This section gives you an overview over all functions that are provided by this module.
They are ordered by sections, all functions within a section are accessible by an export-tag and share a naming convention (i.e: a prefix).
All dollar variables ($test,$tlevel, etc.) are accessible by functions with their name prepended by ``D'' - which means Dollar (a obsolete currency still used in some degenerated countries).
Examples: $test == Dtest
$horolog = Dhorolog
If you want to set a sysvar, pass an argument.
In any case they return their (old) value.
Note that the documentation is - like the correspondending XS-part - magically auto-generated :)
Ddevice()Decode([$new])Destack()Detrap([$new])Dhorolog()Dio()Djob()Dkey()Dprincipal()Dprompt([$new])Dquit()Dreference()Dstack()Dstorage()Dsystem([$new])Dtest()Dtlevel()Dtrestart()Dx([$new])Dy([$new])Dza()Dzb()Dzc()Dzcmdline()Dzcompile([$new])Dzcstatus()Dzdate_form([$new])Dzdir([$new])Dzeditor()Dzeof()Dzerror([$new])Dzgbldir([$new])Dzininterrupt()Dzinterrupt([$new])Dzio()Dzjob()Dzlevel()Dzmaxtptime([$new])Dzmode()Dzpos()Dzproc()Dzroutines([$new])Dzsource([$new])Dzstatus([$new])Dzstep([$new])Dzsystem()Dztexit([$new])Dztrap([$new])Dzversion()Dzyerror([$new])
Functions that provide global access start with ``g_''.
In addition to tstart()/tcommit()/trollback()/trestart(),
Dtlevel() and Dtrestart() are imported by ``:trans'', too.
They work in the same way as the Mumps versions, except that you can't pass local M-variables to tstart and you specify SERIAL by a boolean flag.
Well, I've not really tested these, but at least:
perl -MGTM=:trans -e 'tstart; print Dtlevel; tcommit; print Dtlevel'
prints ``10'', as expected. :)
tcommit()trestart([$level])trollback($levels)
Only unload_gtm() is exported.
Call this function before you call something like exec
or _exit(). It calls gtm_exit() if and only if Perl started
GT.M.
unload_gtm() is called automagically on Perl exit if and
only if Perl started GT.M.
We use the DynaLoader carefully and we try to locate libgtmperl (formally libgtmshr) library by searching in $ENV{gtm_dist} first. It should work even on VMS - please report if not. You may get something like: Subroutine GTM::bootstrap redefined at /usr/local/share/perl/5.8.3/GTM.pm line 40. when using $ZPERLEVAL(...) in GT.M.
This is a simple initialization problem that I'm going to address later :)
the GTM::Perl manpage - for using Perl within GT.M programs
the GTM::GlobalTie manpage, the GTM::Preprocessor manpage, the GTM::Preprocessor::Cache manpage.
Well, look at my ``old'' Cac modules, the GT.M series will get much better :)
Cac, the Cac::ObjectScript manpage, the Cac::Global manpage, the Cac::Routine manpage, the Cac::Util manpage, the Cac::Bind manpage.
Stefan Traby, <stefan@hello-penguin.com> http://www.hello-penguin.com/gtm-perl
Copyright (C) 2004 by Stefan Traby <stefan@hello-penguin.com> Copyright (C) 2004 by KW-Computer Ges.m.b.H., Graz, Austria
This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL).
In addition to this license
Sanchez Computer Associates, Inc.
40 Valley Stream Parkway
Malvern, PA 19355, USA
has the non-exclusive right to do what ever they want with this code.