X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Aug 2019 02:16 PM by  Ellen
Call IDL in perl
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Ellen



New Member


Posts:3
New Member


--
08 Aug 2019 04:52 PM
    Hi All,

    I am trying to call IDL program through perl as following:

    open(IDL,"|/opt/harris/envi5.4.0/envi54/idl86/bin/idl")|| die "Can't open IDL: $!";
    print IDL ".Compile classify \n";
    print IDL "classify \n";
    close(IDL);

    This code works well when there is no ENVI library function in IDL program, but does not work when there is a ENVI function (like ENVITASK) in IDL program.
    The error shows: Variable is undefined: ENVITASK.

    Could you please tell me how to fix this problem when perl call IDL programs with ENVI function?
    Many thanks in advance.

    Ellen

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    09 Aug 2019 05:27 AM
    Did you begin your program with the statement:

    compile_opt idl2

    after this, you would need to start envi with:
    e=envi(/headless)

    Are these statements included?

    Ellen



    New Member


    Posts:3
    New Member


    --
    13 Aug 2019 02:13 PM
    These two sentences have been added in the IDL code. This program works well in the IDL software but does not work after calling by perl. Thanks.

    Ellen



    New Member


    Posts:3
    New Member


    --
    13 Aug 2019 02:16 PM
    This two sentences have been added in the IDL code and this code works well in the IDL software. However, it does not work after calling by perl. I think the reason may relate to the environment variables of perl. I am not sure how to add the ENVI-based environment variables to perl.

    Thanks,
    Xiao
    You are not authorized to post a reply.