Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, Can someone tell me how to handle the vt100 sequences using expect = module of perl. I have used the same sequences while using TCL Expect. It works fine. = But I don't understand what is the problem while I try doing the same = thing using Perl Expect. If my TCL Expect Code goes like:- =20 send "\x09" # hexadecimal equivalent of a tab expect "\x1b?2;2H" What should be the equivalent Perl code? I am able to send "\x09" in perl but I think it doesn't expect the = correct thing. Perhaps the semicolon has to be escaped but even after = escaping the semicolon didn't solve the problem. Can someone give some help or reference link where I can learn what = these values like "\x1b?2;2H" mean. Thanks
Post Follow-up to this messageTapasranjanMohapatra wrote: > Hi, > Can someone tell me how to handle the vt100 sequences using expect module of perl. > I have used the same sequences while using TCL Expect. It works fine. But I don't understand what is the problem while I try doing the same thing usi ng Perl Expect. > If my TCL Expect Code goes like:- > > send "\x09" # hexadecimal equivalent of a tab > expect "\x1b?2;2H" > > What should be the equivalent Perl code? > I am able to send "\x09" in perl but I think it doesn't expect the correct thing. Perhaps the semicolon has to be escaped but even after escaping the semicolon didn't solve the problem. > Can someone give some help or reference link where I can learn what these values > like "\x1b?2;2H" mean. Most likely, the problem is that Perl is interpreting what is in the quotes first. Try putting it in single quotes when you pass it to expect. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548
Post Follow-up to this messageTapasranjanMohapatra wrote: > Hi, > Can someone tell me how to handle the vt100 sequences using expect > module of perl. I have used the same sequences while using TCL > Expect. It works fine. But I don't understand what is the problem > while I try doing the same thing using Perl Expect. If my TCL Expect > Code goes like:- > > send "\x09" # hexadecimal equivalent of a tab > expect "\x1b?2;2H" > > What should be the equivalent Perl code? > I am able to send "\x09" in perl but I think it doesn't expect the > correct thing. Perhaps the semicolon has to be escaped but even after > escaping the semicolon didn't solve the problem. Can someone give > some help or reference link where I can learn what these values > like "\x1b?2;2H" mean. Those sequences look OK to me. $ perl -e 'print "\x09"' | od -ca 0000000 \t ht $ perl -e 'print "\x1b?2;2H"' | od -ca 0000000 033 ? 2 ; 2 H esc ? 2 ; 2 H Show us the Perl code you're using.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.