Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Handle Ctrl-C on Windows

by jethro (Monsignor)
on Aug 28, 2012 at 09:49 UTC ( #990203=note: print w/replies, xml ) Need Help??


in reply to Handle Ctrl-C on Windows

I don't get that warning on linux, so can't test, but the problem seems to be that the chomp is executed even after you pressed ctrl-C. Did you try to move the chomp on a line by itself or add a noop inbetween so that there is another statement to break on?

my $choice = <>; chomp($choice); #or even my $choice = <>; $choice=$choice; chomp($choice);

Replies are listed 'Best First'.
Re^2: Handle Ctrl-C on Windows
by cztmonk (Monk) on Aug 28, 2012 at 10:14 UTC

    Thanks for your advice.Tried both, but the same results :(

     

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990203]
help
Chatterbox?
[1nickt]: Corion HPs? ugh. I was impressed with Lenovo's gaming laptops; if it weren't for the red backlighting and general flashiness of the aesthetic, I might have gone with that. But all that was until I discovered that the Dell Precision line is still around.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (15)
As of 2017-03-27 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.