Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: CTRL+C Regular Expression

by wirito (Acolyte)
on Nov 07, 2012 at 11:21 UTC ( #1002655=note: print w/ replies, xml ) Need Help??


in reply to CTRL+C Regular Expression

It could be interesting to know how you are sending "Ctrl+C". Also, I can't figure how you came that Ctrl+C is the same as '\x03'.
If you 'open' a shell process and send '\x03' it won't be interpreted as Ctrl+C but as chr(3):

$ perl -e 'open F, "|cat>test" or die("cant open"); print F "\x03"; cl +ose F' $ hexdump -C test 00000000 03 |.| 00000001
However If you mean pressing 'Ctrl+C' the shell will send a signal (nothing to do with values) that you can trap as Athanasius said before.
$ perl -e '$SIG{INT} = sub { die "Got signal" }; while() {};' [Press CTRL+C] Got signal at -e line 1.


Comment on Re: CTRL+C Regular Expression
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (15)
As of 2015-07-02 19:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls