【问题标题】:Call Perl within Tcl在 Tcl 中调用 Perl
【发布时间】:2011-03-04 10:32:25
【问题描述】:

快速提问。

如何在 tcl 中调用 perl 脚本(使用参数)并收集输出并将其存储在变量中,稍后将在 IRC 上打印输出(使用 eggdrop)。

谢谢! =)

【问题讨论】:

    标签: perl tcl interaction


    【解决方案1】:

    只需:set perl_output [exec perl -lane {perl_script(goes => $here)} file]

    【讨论】:

      【解决方案2】:

      通常在 Tcl 中,您会使用 exec 或 open 之类的东西来执行此操作。请参阅有关 exec 的文档:http://www.tcl.tk/man/tcl8.5/TclCmd/exec.htm 并打开:http://www.tcl.tk/man/tcl8.5/TclCmd/open.htm

      如果您不想执行外部 perl 解释器,您可以获取 tclperl 包并内联运行它,这可能会更快: http://jfontain.free.fr/tclperl.htm (来源见此链接:http://jfontain.free.fr/tclperl-3.2.tar.bz2

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多