Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Using Perl Expect.pm
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

Report this thread to moderator Post Follow-up to this message
Old Post
Tapasranjanmohapatra
03-27-04 04:15 AM


Re: Using Perl Expect.pm
TapasranjanMohapatra 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


Report this thread to moderator Post Follow-up to this message
Old Post
Andrew Gaffney
03-27-04 04:15 AM


RE: Using Perl Expect.pm
TapasranjanMohapatra 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.

Report this thread to moderator Post Follow-up to this message
Old Post
Bob Showalter
03-27-04 04:15 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:01 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.