在过程退出之前是否可以从perl CGI打印? [英] Is it possible to print from a perl CGI before the process exits?

查看:54
本文介绍了在过程退出之前是否可以从perl CGI打印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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.

所以,我的问题是:

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

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.

推荐答案

# Tell Perl not to buffer our output
$| = 1;

这篇关于在过程退出之前是否可以从perl CGI打印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆