SR has asked for the wisdom of the Perl Monks concerning the following question:

I am having a script written in Expect. It is in the following format
#!/usr/bin/expect . . <Common Variables> . . [Title1] Code1 [Title2] Code2 . .
Now the thing I need is to run this script from inside Perl and display the titles alone in the perl GUI. Whenever I select the titles, the corresponding Expect code should be executed.

The problem is that the common variables are so large, that it cant be executed everytime. So what is required is a kind of way to embed expect interpreter inside perl code, so that the common variables already executed are in memory and only the code associated with the title needs to executed. Is there any way or solution for my problem?

Thanks

SR

Replies are listed 'Best First'.
Re: Perl Expect
by friedo (Prior) on Dec 01, 2006 at 05:21 UTC
    Perl has its own implementation of Expect, which you may find useful. It should be pretty easy to translate your existing Expect scripts to Perl subroutines using the Expect module.
      I have already tried using Expect.pm, but I dont want to modify the existing code into perl format. I should be able to run the existing Expect code as it is. Like the one something like TCL-0.91 in CPAN