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

Re^5: Timed STDIN input via threads on Win32

by dasgar (Curate)
on Nov 19, 2013 at 04:24 UTC ( #1063262=note: print w/replies, xml ) Need Help??

in reply to Re^4: Timed STDIN input via threads on Win32
in thread Timed STDIN input via threads on Win32

I badly need to make this timed STDIN work because the script will be used manually as well as run as a cron/scheduled task.

Here's one thought that may or may not work. How about using command line parameters and one of the Getopt modules to specify whether the script should run in batch mode (i.e. no user input) versus interactive mode (i.e. requires user to interact with the script). Going this route would mean that you can not bother with user input for the batch mode and to wait indefinitely for user input in interactive mode. Without knowing anything further about what your full code is doing, I think that this could potentially eliminate your timeout needs.

  • Comment on Re^5: Timed STDIN input via threads on Win32

Replies are listed 'Best First'.
Re^6: Timed STDIN input via threads on Win32
by markperlb0y (Initiate) on Nov 19, 2013 at 04:55 UTC

    Thanks for the tips. I just needed it to work that way so that the script can be run via cron without changing anything.

    Anyway, changing it to behave differently wouldn't take more than a few seconds. I can live with that. I just really wanted to know why my program behaves that way and if there's something I can do about it. It's big script that talks to web applications, processes xml's, writes excel spreadsheets and sends emails etc. I didn't really have to ask a question from the beginning as most of the time google solves my problem. I just got stuck with this one and it bothers me that I was able to solve all my bigger problems before but quite clueless with this one.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063262]
[marto]: good morning all
[Corion]: Hi marto!

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-08-21 09:13 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (319 votes). Check out past polls.