Problem in fetching the return value of the executed program.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shrek123
    New Member
    • Aug 2007
    • 23

    Problem in fetching the return value of the executed program.

    Hi,
    I want to execute some script (May or May not be perl script) from a perl script and print the output of that executed script.
    My Operating system are Windows and Mac OS(Unix).
    I was trying the following code without success:

    Code:
    $Response = system("start test.wbt");
    print $Response;
    By the above code I am able to execute test.wbt but program doesnt wait for response.
    or
    Code:
    $Response = system ("start test.wbt");
    print $Response;
    But none of the thing work.
    Please help me what i m doing wrong also it would be nice if somebody could explain me why the above program fails.

    Thanks!!!!!
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    I guess you didn't RTM. system() does not return output. You want to use the qx// operator:

    Code:
    $response = qx/start test.wbt/;

    Comment

    Working...