Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: Perl replacement for choice.com

by onelander (Sexton)
on Mar 04, 2013 at 21:50 UTC ( #1021714=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl replacement for choice.com
in thread Perl replacement for choice.com

I realized I never made it clear as to why I was doing this. It appears that on Windows 7 32 and 64 bit, you can run into scenarios where choice will never timeout even though it is supposed to.

The problem shows up when the window gets and loses focus when the prompt is showing on screen. Unfortunately, we run into it somewhat often due to scripts we use. Since we jump back and forth between windows it is possible to encounter this problem multiple times in a script run. I ran into once today and it has been encountered by other members of my team.

Replies are listed 'Best First'.
Re^5: Perl replacement for choice.com
by BrowserUk (Pope) on Mar 05, 2013 at 00:42 UTC
    It appears that on Windows 7 32 and 64 bit, you can run into scenarios where choice will never timeout even though it is supposed to.

    Hm. Can't reproduce that.

    It's also pretty implausible that a sleep within a console application would in any way be affected by whether the console it is running in has focus or not.

    But if your Perl script works for you; that's all that matters :0


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      What is interesting is that the problem does not appear to be a sleep at all but the actual Microsoft choice program.

      The batch scripts don't use sleeps when calling choice since it handles all of that itself. The batch scripts just wait for return codes.

      Either way, I have been able to make the code much more CPU efficient but I am running into some other problems with Win32 support of signals. It also helps in that it gives me more learning opportunities.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021714]
help
Chatterbox?
[thao4]: Hi all, I am new in perl. I need do somthing in perl: exemple: - search a patern "CADRE 1.1 CPU" in one file.txt - incremente +30 lines from the line with the patern found - replace the patern "Model Regle" by "Heath Rule A" in this new line (30 line
[marto]: good morning all
[hippo]: Welcome. Tell me, have you read perlintro? That's a great place to start.
[thao4]: I seach to do that since a week but I can't found the answer in google. Thank for your help
[Eily]: hello thao4 (and hello all :D), you should [id://http:// perlmonks.org/ index.pl?node_id= 479#post|open a question on Seekers of Perl Wisdom], be sure to include whatever you have tried that didn't work, or only does the job partially
[thao4]: yes, I do a little perl since some years but not fréquently, I can correct the triggers in Clearcase of IBM, but write the code : no
[Eily]: meh, such good link ...
[Eily]: here
[Eily]: still not xD there

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2018-02-21 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (276 votes). Check out past polls.

    Notices?