Calling IDL from Perl [message #26971] |
Wed, 03 October 2001 10:35 |
gary.hodgesREMOVE
Messages: 9 Registered: October 2001
|
Junior Member |
|
|
OK, I have distilled my problem down to the simplest example I can. My
problem is that the Perl script finishes before the IDL script is executed.
I have tried sleep commands, but the results are the same. What can I do to
get the IDL script to execute before the Perl script prints the contents of
@ary? Below are the two scripts and the output.
Cheers,
Gary
#!/usr/bin/perl
open(IDL, "|/usr/local/bin/idl");
print IDL ".Compile loop \n";
print IDL "loop \n";
@ary=(5,6,7,8);
for (@ary) {
print "$_\n";
}
----------------------------------
PRO LOOP
FOR j=1,4 DO BEGIN
Print, j
ENDFOR
END
==================================
The output when I run the Perl code is:
phoenix> perl loop.pl
5
6
7
8
phoenix> IDL Version 5.4 (sunos sparc). (c) 2000, Research Systems, Inc.
Installation number: 100780-40.
Licensed for use by: OAR/ARL:Chris Cornwall:SUN100
% Compiled module: LOOP.
1
2
3
4
|
|
|