diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 2003-06-14 10:49:57 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-15 17:08:02 +0000 |
commit | 622913ab81739f4a9419ed541a122ff2495c8ab1 (patch) | |
tree | 06a71ddf809f0904979a43c23c68dae3939718db /os2/perlrexx.cmd | |
parent | 41be1fbddbbc49a5c34acad74f2905b11dd0ced0 (diff) | |
download | perl-622913ab81739f4a9419ed541a122ff2495c8ab1.tar.gz |
OS2 patches
Message-ID: <20030615004956.GA28272@math.berkeley.edu>
p4raw-id: //depot/perl@19789
Diffstat (limited to 'os2/perlrexx.cmd')
-rw-r--r-- | os2/perlrexx.cmd | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/os2/perlrexx.cmd b/os2/perlrexx.cmd new file mode 100644 index 0000000000..5a32d85105 --- /dev/null +++ b/os2/perlrexx.cmd @@ -0,0 +1,68 @@ +/* Test PERLREXX.DLL */ +/* Example: + perlrexx.cmd BEGIN {push @INC, 'lib'} use OS2::REXX; REXX_eval "address cmd\n'copyy'"; + */ + +call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +call SysLoadFuncs + +parse arg args +retval = runperl(args) +say 'retval = "'retval'"' +exit 0 + +addperl: procedure + parse arg perlf + pathname='perlrexx' + r = RxFuncAdd(perlf, pathname, perlf) + say "RxFuncAdd("perlf","pathname") -> "r + return + +runperl1: procedure + parse arg perlarg + call addperl('PERL') + call addperl('PERLTERM') + call addperl('PERLEXIT') + call addperl('PERLEVAL') + call addperl('PERLLASTERROR') + signal on syntax name runperl_error +/* signal on error name runperl_error + signal on failure name runperl_error */ + say "doing PERLEVAL("perlarg")" + tmp = PERLEVAL(perlarg) + say "PERLEVAL -> '"tmp"'" + signal off syntax + call RxFuncDrop 'PERL' + call RxFuncDrop 'PERLLASTERROR' + call RxFuncDrop 'PERLTERM' + call RxFuncDrop 'PERLEVAL' + call PERLEXIT + call RxFuncDrop 'PERLEXIT' + return pathname ': PERLEVAL('perlarg') =' tmp + +runperl: procedure + parse arg perlarg + pathname='perlrexx' + r = RxFuncAdd("PerlExportAll", pathname, "PERLEXPORTALL") + say "RxFuncAdd("'PerlExportAll'","pathname") -> "r + r = PerlExportAll() + say "PerlExportAll() -> "r + signal on syntax name runperl_error +/* signal on error name runperl_error + signal on failure name runperl_error */ + say "doing PERLEVAL("perlarg")" + tmp = PERLEVAL(perlarg) + say "PERLEVAL -> '"tmp"'" + address evalperl perlarg + say "Did address evalperl "perlarg + signal off syntax + r = PerlDropAllExit() + /* The following line is not reached... Why? */ + say "PerlDropAllExit() -> "r + return pathname ': PERLEVAL('perlarg') =' tmp + + +runperl_error: + return pathname ': REXX->Perl interface not available; rc="'rc'", .rs="'.rs'", errstr="'errortext(rc)'", perlerr="'PERLLASTERROR()'"' + +/* return pathname ': REXX->Perl interface not available; rc="'rc'", .rs="'.rs'", errstr="'errortext(rc)'", perlerr="???"' */ |