Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^5: Timed STDIN input via threads on Win32

by dasgar (Priest)
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]
and all is quiet...

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

    Results (274 votes). Check out past polls.