comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Using IDL from a perl script
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Using IDL from a perl script [message #56418 is a reply to message #56407] Sat, 20 October 2007 16:16 Go to previous messageGo to previous message
jkj is currently offline  jkj
Messages: 48
Registered: April 2007
Member
On Oct 19, 1:02 pm, James Everton <james.ever...@gmail.com> wrote:
> Hi everybody,
>
> I'm developing some web scripts in perl that interact with a database
> through various pre-written IDL procedures here at my work. The
> problem I'm having is getting arguments passed between the two.
> Passing from the perl into the IDL code is easy enough because I'm
> using the open( ) procedure and simply writing the strings as a block:
>

I've done this a bunch and found it to be very useful... here's a bit
more of what I find works:

use IPC::Open2;

$progName = "idl";
open2(READIDL, WRITEIDL, $progName) or die "Could not begin \"$progName
\"\n";

# Then you can cause IDL to execute commands like this:
print WRITEIDL "value = 13\n";

# I find that output coming back from IDL is cluttered, so before
# asking IDL to return a value I ask it to spit out "junk":
print WRITEIDL "print, \"junk\"\n";
while(!(<READIDL> =~ /junk/)){
}

# Now I can get the value I want back asking IDL to output it:
print WRITEIDL "print, value\n";
$value = <READIDL>;
chomp($value);

...hope that helps,
-Kevin
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: using cursor on multiplot data
Next Topic: how to generate latitude/longtitude image from projected image?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:46:52 PDT 2025

Total time taken to generate the page: 0.23705 seconds