是否可以在进程退出之前从 perl CGI 进行打印?

发布于 2024-09-14 03:17:21 字数 243 浏览 1 评论 0原文

我有一个 perl CGI,它需要在进入一个通常需要几分钟的非常漫长的过程之前向浏览器报告一些信息。

目前我打印了该消息,但直到整个进程退出后它才显示。

所以,我的问题是:

是否有可能将消息返回到浏览器中流,如果不是,

我如何生成一个单独的进程来处理冗长的位,以便我可以退出初始进程,从而让用户获得他们需要的反馈。

当漫长的过程完成时,不需要通知用户,因此,只要服务器继续运行,我就可以退出。

I have a perl CGI that needs to report some information back to the browser before it goes into a really lengthy process that frequently takes several minutes.

Currently I print the message but it doesn't show up till the entire process exits.

So, my question is:

Is it possible to get the message back to browser mid stream and if not

how do I spawn off a separate process to handle the lengthy bit, so that I can exit out of the initial process and thus have the user get the feedback they need.

The user doesn't need to be notified when the lengthy process is completed, so, I'm fine with quitting as long as the server keeps chugging at it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柏拉图鍀咏恒 2024-09-21 03:17:21
# Tell Perl not to buffer our output
$| = 1;
# Tell Perl not to buffer our output
$| = 1;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文