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

Hi, Im currently automating a feature on cisco which requires me to enter the "conf t" mode to make configurations. On making configurations , i need to enter CNTL/Z ('control' key and 'Z' key pressed together) to come out of that mode. How do i enter the keystroke sequence "CNTL/Z" via perl? Thanks in Advance!

Replies are listed 'Best First'.
Re: Automation of keystroke sequence
by Anonymous Monk on Mar 04, 2009 at 13:01 UTC
Re: Automation of keystroke sequence
by Lawliet (Curate) on Mar 04, 2009 at 20:51 UTC

    print "\cZ";

    You can print other ctrl characters too--just replace the Z with another letter. (Thanks, Person'snameIforgot for the lesson on this very topic last week.)

    And you didn't even know bears could type.