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

After several months I finally have the opportunity to follow up on a suggestion (Re^3: Pre-empting STDIN during Testing) made here by dragonchild to study Expect::Simple. So far I'm understanding everything except the after() method. With respect to this method, Expect::Simple rather cryptically says: "This returns the 'after' string. Please read the Expect docs for more enlightenment."

So I turned to the docs for Expect and read the following:

$object->after ... returns the 'after' part of the last expect() call. If the last expect() call didn't match anything, exp_after() will return undef().

Now, saying that the 'after' method returns the 'after' part of the last call doesn't seem to clarify matters much. Would it be possible for someone who has used Expect::Simple to provide a brief example?

Thank you very much.

Replies are listed 'Best First'.
Re: Expect::Simple::after()
by runrig (Abbot) on Aug 11, 2005 at 00:00 UTC
    It is the text following the text that the last expect() call matched.