Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Perl Expect is not sending multiple commands

by Argel (Prior)
on Sep 18, 2012 at 18:08 UTC ( #994325=note: print w/replies, xml ) Need Help??

in reply to Re^2: Perl Expect is not sending multiple commands
in thread Perl Expect is not sending multiple commands

Usually '#' indicates you are in enable mode and '>' indicates you are in normal mode (i.e. not all commands are available).

I think you can do a regex like below (untested), though there is probably a cleaner/better way to do it.

($which,$why,$match,$before,$after) = $expect_instance->expect($Timeou +t, '-re', "(#)|(>)");

Elda Taluta; Sarks Sark; Ark Arks
My deviantART gallery

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994325]
[Discipulus]: ovedpo15 A subroutine may be called using an explicit & prefix. The & is optional in modern Perl... see perlsub in docs and search for ampersand
[Discipulus]: it has some, even dangerous, implication
[Discipulus]: I still use but I also attract many critics for this: I use when I call subs defined in the very same file, just to recognize them. You can avoid (but sometimes is needed)
[marto]: believe it or not this is a SPAM account :P
[Discipulus]: it seems a legitimate one.. grin ..

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2018-05-22 12:14 GMT
Find Nodes?
    Voting Booth?