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

Home » Public Forums » archive » Re: Command line arguments
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: Command line arguments [message #42533 is a reply to message #42532] Fri, 11 February 2005 14:11 Go to previous messageGo to previous message
Mr. No Address is currently offline  Mr. No Address
Messages: 11
Registered: February 2005
Junior Member
Mr. No Address wrote:
> Craig Markwardt wrote:
>
>> "Mr. No Address" <no_given_address@landofthelost.net> writes:
>>
>>> Way back in the day I posted a very similar question. Someone gave me a
>>> solution using environment variables that has worked fine all this
>>> time, but now I'm updating things and I'm seeking a cleaner solution.
>>> Here we go...
>>>
>>> I have a Perl program that I compile and run an IDL program from. I'm
>>> now looping through several hundred times and it seems wasteful to
>>> compile the IDL program every loop.
>>>
>>> # The relevant Perl code...
>>> $ENV{"file"}="$filepath";
>>> open(IDL, "|/usr/local/bin/idl") || die "Can't open IDL: $!";
>>> print IDL ".Compile mentor \n";
>>> print IDL "mentor \n";
>>> close IDL;
>>>
>>> # The relevant IDL code...
>>> PRO mentor
>>> file=GETENV('file')
>>>
>>> I would like to compile the program once outside the loop and then pass
>>> the file using an argument instead grabbing the file from an environment
>>> variable. Can I do something like this?
>>>
>>> print IDL "mentor, $filepath\n";
>>
>>
>>
>> You need to put quotation marks around it, as in:
>>
>> print IDL "mentor, '$filepath'\n";
>>
>> That has worked for me in the past.
>
>
> Thanks for the reply Craig. How do I assign $filepath to a variable in
> the IDL code?

OK, I figured out this part of it. I changed the first line in the IDL
file to:
PRO mentor, file ; I added "file"

Now I seem to have a Perl problem in that I think Perl is executing the
lines after

print IDL "mentor, '$filepath'\n";

before it writes the idl.ps file. Seems I ran into this way back when too.

Thanks,
Gary
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dynamically resizing arrays
Next Topic: how to rerun subroutine only?

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

Current Time: Fri Nov 28 09:42:11 PST 2025

Total time taken to generate the page: 0.47223 seconds