S
Stephen O'D
I have a script that asks for some input on several screens, and at the
end it kicks off a connection to a database which does some work that
could potentially take a long time. I dont want to hold up displaying
the webpage while this is running - I would prefer to print a message
to the browser saying the job is running in the background. In other
works, I want to allow the script to continue running, but notify the
browser that I have finished talking to it.
I found a script written by Randal Schwartz that says todo this all you
have todo is close STDIN and STDOUT:-
open STDIN, "</dev/null";
open STDOUT, ">/dev/null";
However when I do this the script seem to die (although no die message
gets into the error logs - it just seems to give up silently). Also, a
system command to copy a file gives an error "Not A Typewriter". If I
remove the system command, the database connection does not work
correctly (it seems to work sometimes though??!!).
How can I 'disconnnect' the browser let my script continue todo some
work? I would prefer not to fork.
Thanks,
Stephen.
end it kicks off a connection to a database which does some work that
could potentially take a long time. I dont want to hold up displaying
the webpage while this is running - I would prefer to print a message
to the browser saying the job is running in the background. In other
works, I want to allow the script to continue running, but notify the
browser that I have finished talking to it.
I found a script written by Randal Schwartz that says todo this all you
have todo is close STDIN and STDOUT:-
open STDIN, "</dev/null";
open STDOUT, ">/dev/null";
However when I do this the script seem to die (although no die message
gets into the error logs - it just seems to give up silently). Also, a
system command to copy a file gives an error "Not A Typewriter". If I
remove the system command, the database connection does not work
correctly (it seems to work sometimes though??!!).
How can I 'disconnnect' the browser let my script continue todo some
work? I would prefer not to fork.
Thanks,
Stephen.