-2

我正在使用 Perl 的Net::Telnet模块来访问通过 telnet 可用的应用程序。

我正在使用$telnet->waitfor()$telnet->print()方法来确定收到的表格并提交适当的数据。其中一种形式有两个选项——“查找”和“取消”。

在终端中,我只需按 TAB 键选择“取消”并回车即可。但在脚本中,发送 TAB 对我不起作用,即:

$telnet->print('\t')

或者

$telnet->print("\t")

有谁知道如何解决这个问题?

4

2 回答 2

2

To send a tab, you need to send the actual bits that represent the tab. The single-quoted version, '\t' won't do that. To turn \t from it's logical form to the right bit representation, you need the double-quote interpolation.

于 2009-07-02T14:44:49.523 回答
0

实际上 $telnet->print("\t") 正在工作。

于 2009-07-01T20:56:15.897 回答