Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The ESC character is chr(27), but you're looking for chr(23). The reason? /^\027/ is looking for octal 27 which is decimal 23. You should use /^\033/ which will give you what you're looking for. Update: I (briefly) looked around, but didn't find a link to perl documentation on escaping numbers in strings. In an expression, prefix of '0' on a number tells perl to use octal, and a prefix of '0x' tells it to use hexadecimal. In a string, it's similar, you use a prefix of '\0' for octal, and '\x' for hexadecimal. Update 2: Perlbotics provided a link perlnumber to what I was looking for, and corrected me on the prefix used for hexadecimal in strings. I clarified the previous update accordingly. The way I worded it previously would have had people using '\0x4C' expecting an 'M', but they'd get chr(0) followed by 'x4C'. ...roboticus When your only tool is a hammer, all problems look like your thumb. In reply to Re: Can't exit, except when I press ^C?
by roboticus
|
|