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

Hi Revered Monks, I have the right characters to send a CNTRL-] which is: $ssh->send("\x1D"); However, it will only execute when I put it in this loop:
$ssh->waitfor('COR>',2) or die "Where is prompt"; my $line; while ( defined ($line = $ssh->read_all()) ) { $ssh->send("\x1D"); print $line . "\n"; }
When that code above is run it shows the return prompt which is "telnet>", of course then it loops forever. When I try to use the send statement in its proper place (below) it does not work.
$ssh->waitfor('COR>',2) or die "Where is prompt"; $ssh->send("\x1D"); $ssh->waitfor('telnet>',2) or die "Where is prompt"; $ssh->send("q"); $ssh->waitfor('>',2) or die "Where is prompt"; $ssh->send("touch /home/fworks/the.file"); $ssh->waitfor('>',2) or die "Where is prompt"; my $line; while ( defined ($line = $ssh->read_all()) ) { $ssh->send("bogus"); print $line . "\n"; }
The loop sending the bogus text shows that the return prompt is the previous prompt and the it never broke out of the telnet session. Clearly I am going about this all wrong. Thank you!