Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Run and kill external programm after x seconds

by demichi (Beadle)
on Nov 22, 2016 at 14:13 UTC ( #1176337=note: print w/replies, xml ) Need Help??


in reply to Re: Run and kill external programm after x seconds
in thread Run and kill external programm after x seconds

Hi,

my problem is that I run an external program X (I do not have control of this program X) and I get output from this program X. This program X may dies or don't give answer for hours.

I would like to wait for e.g. 60 seconds and if there is no new input from this program X it should be closed/killed and my perl program should go on with next steps.

kind regards, de michi

  • Comment on Re^2: Run and kill external programm after x seconds

Replies are listed 'Best First'.
Re^3: Run and kill external programm after x seconds
by ww (Archbishop) on Nov 22, 2016 at 16:30 UTC

    So would it not work to reverse the logic of the m/.../ or -- at the 60 second mark -- to simply test for a void as below?

    D:\_scratch>perl -e "my $foo=''; if ($foo =~//){ print 'found nothing' +;} exit();" found nothing D:\_scratch>

    ++$anecdote ne $data

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176337]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-05-17 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (68 votes). Check out past polls.

    Notices?