Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^3: How to call a script interactively from perl

by zentara (Archbishop)
on Oct 16, 2012 at 11:07 UTC ( #999285=note: print w/replies, xml ) Need Help??

in reply to Re^2: How to call a script interactively from perl
in thread How to call a script interactively from perl

You have me confused. How can you terminate the script in a way that allows it to output to a file? You need to describe in exact detail how this third party script runs. Maybe you are looking to put the process in the background, i.e. a background process?

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re^3: How to call a script interactively from perl

Replies are listed 'Best First'.
Re^4: How to call a script interactively from perl
by LetMeAsk (Initiate) on Oct 16, 2012 at 14:34 UTC
    I am sorry to confuse you, ok here i go again: There is an existing script (Lets call it ThirdPartyScript and i cannot do any modifications to it) which performs some processing and displays output on the STDOUT and at the end it asks for options. For example, when you provide an option "i" it means include flag and you can specify any search string. It then retrieves the results matching that search string from its database and after displaying those results it again wait for next action with the following prompt:
    Select option:
    Now, either you can provide next option as i (to include other search string or "d" to delete the listed results etc or "X" to quit script. Now, i am writing a perl script with the intention to run above thirdpartyscript with a specific search string from this perl code and write the result of this run to a unix file. Then again my perl code will email this output file to the interested parties. My perl code works fine when i run that for any other command (e.g. ls), but when i run that for the above third party script, it never completes execution and the output file never populated. So, i thought may be it is because the thirdpartyscript do not exit execution until an "x" is specified as explained above. Please let me know if it helps. Thanks


      This sounds to me like your ThirdPartyScript handles the input from a console/terminal which is a little bit differnet than reading from STDIN. If this is the case then have a look at

      Best regards

        Thanks i read about and looks like it can help but do you think there is nay other solution to this (within Perl)? as i do not have installed on my production systems.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999285]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-03-20 12:38 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (251 votes). Check out past polls.