【问题标题】:How to make Perl fall back to just execute without debugging when it fails to connect to remote host?当 Perl 无法连接到远程主机时,如何让 Perl 回退到只执行而不进行调试?
【发布时间】:2011-07-13 05:44:06
【问题描述】:
[root@ test]$ PERLDB_OPTS=RemotePort=localhost:1111 perl -d typeglob
Unable to connect to remote host: localhost:1111
Compilation failed in require.
 at typeglob line 0
        main::BEGIN() called at /usr/lib/perl5/5.8.8/perl5db.pl line 0
        eval {...} called at /usr/lib/perl5/5.8.8/perl5db.pl line 0
BEGIN failed--compilation aborted.
 at typeglob line 0

如您所见,当连接失败时,程序就会失败并退出。我怎样才能让它像在那种情况中没有指定-d一样运行?

【问题讨论】:

    标签: perl remote-debugging


    【解决方案1】:

    我不明白您在这里尝试执行的任务。不确定为什么要在这里调用 perl 调试器?但我想知道该 CLI 命令是否有返回码?

    如果是这样,也许您可​​以编写一个 shell 脚本以第一种方式执行 perl,如果它返回失败代码,只需更改 CLI 以在没有 -d 开关的情况下执行。

    因此,换句话说,可能有一种 perl 方法可以做你想做的事,但有很多方法可以给猫剥皮......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-08
      • 2012-11-04
      • 1970-01-01
      • 2012-11-07
      相关资源
      最近更新 更多