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 #42536 is a reply to message #42535] Fri, 11 February 2005 12:46 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"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.

Good luck!
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[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 10:36:44 PST 2025

Total time taken to generate the page: 6.56529 seconds