Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: Timed STDIN input via threads on Win32

by dasgar (Deacon)
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
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-25 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls