Robert Sundstrom wrote:
> Hello all.
> I have been trying to integrate DCL-scripts with Perl-programs. It works
> fine when one is using temporary files to build the sequence of
> DCL-commands you want. On the VMS Perl FAQ I learned about a method to
> execute several DCL-commands in a row without using temporary files.
>
> Unfortunately, it does not work well if you have a DCL-script that ends
> with exit 44, that is forcing an abort. The Perl program never resumes
> execution after the print statement. Something probably aborts (just as it
> is supposed to... :-), and control is never returned to Perl.
>
> I don't have enough VMS-diplomas to determine if this is a feature, a
> misfeature or a bug. I simply either want my Perl script to abort as well,
> or to be able to detect the EXIT parameter of the DCL-script in my Perl
> program. Does anyone have any advice on this matter?
>
> This is my source code:
>
> A.COM
>
> $ EXIT 44
>
> A.PL
>
> open(CMD,"|\@sys\$input");
> print CMD "\@a.com\n";
> close(CMD);
> exit;
>
> A little transcript of my output:
>
> ROBERT>type a.com
> $ exit 44
>
> ROBERT>perl a.pl
> %SYSTEM-F-ABORT, abort
> Interrupt
>
> ROBERT>stop
It is not clear to me why you wanted to open a pipe to this procedure,
although in general I suppose you might want to. Here for illustration
purposes is a run of a perl program that @executes a DCL procedure without
the pipe:
$ type a.com
$ write sys$output "hello from " + f$environment("PROCEDURE")
$ exit 44
$ type a.plx
print "Hello from $0\n";
print `\@a.com`;
print "goodbye from $0\n";
$ perl a.plx
Hello from a.plx
hello from USR:[PVHP]A.COM;1
%SYSTEM-F-ABORT, abort
goodbye from a.plx
I hope that helps you.
Peter Prymmer