【发布时间】:2015-06-30 09:04:36
【问题描述】:
在我的 Perl 代码中,我使用系统命令来运行脚本。我正在使用 Gtk2::Perl 和 Glade 来构建 UI。我需要将命令的输出不仅捕获到控制台(Capture::Tiny 确实如此),而且还捕获到我的 GUI 中的 TextView。
system("command");
$stdout = tee{ #This captures the output to the console
system("command");
};
$textbuffer->set_text($stdout); #This does set the TextView with the captured output, but *after* the capture is over.
任何帮助将不胜感激。
【问题讨论】:
-
那么你遇到了什么问题?
-
我需要在 TextView 中捕获
system的输出,同时在控制台上捕获它。这不会发生。