Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners Cgi > Re: Help on rea...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 1403 of 1483
Post > Topic >>

Re: Help on reading esc sequence

by susheelm@[EMAIL PROTECTED] (Susheel Koushik) Jun 11, 2007 at 07:34 PM

hi amrita,

use if($var1 =~ '\e') inplace of if(var1 eq '\e')



On 6/11/07, Amrita Roy <amritaroy2005@[EMAIL PROTECTED]
> wrote:
> Hello,
> Actually i m running a process using perl script.so i want to do that if
i
> press ESC from the keyboard it will come out of the loop n comes out of
the
> function.I am trying to read the esc character using "\e"but it is not
> responding.I have even tried with hex (1B) value of esc charcter but
still
> it was not respoding .
> Here is code snippet:
>
> #!/C:/Perl/bin -w
>  my $var1;
>
> $var1 = <STDIN>;
> if($var1 eq '\e')
> {
>   print "Hello \n";
> }
>
> else
> {
>   print "World \n";
> }
>
>
> --
> Amrita Roy
> Rebaca Technology Pvt Ltd.
> Sector 5, Saltlake,
> Kolkata
> Email : amrita@[EMAIL PROTECTED]
>
 




 5 Posts in Topic:
Help on reading esc sequence
amritaroy2005@[EMAIL PROT  2007-06-11 18:53:26 
Re: Help on reading esc sequence
susheelm@[EMAIL PROTECTED  2007-06-11 19:34:32 
Re: Help on reading esc sequence
tigger@[EMAIL PROTECTED]   2007-06-11 10:05:08 
Re: Help on reading esc sequence
mritty@[EMAIL PROTECTED]   2007-06-11 07:52:51 
Re: Help on reading esc sequence
mritty@[EMAIL PROTECTED]   2007-06-11 10:55:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 11:41:12 CDT 2008.