Welcome to WebmasterWorld Guest from 22.214.171.124
I have a perl-cgi script that is running fine when one user runs it.
How do i make it run for many users? My basic knowledge tells me that I have to use sessions. But How?
I am mot into web programming. Any basic pointers or sample scripts will be appreciated?
you really only need sessions if you need to maintain persistent data for each visitor.
typically sessions are maintained by using cookies or a session id parameter, which is what the CGI::Session module will do for you.
perl-cgi script (hosted on apache server) is running fine when one user runs it through web page. The script is called when user selects some arguments and presses submit button from HTML form using get method. The script inturn calls some batch files using system command and does some other things depending on the arguments selected by user.
Currently if more than one user tries to run the script, the user starting later gets errored out because the system command that runs batch file throws an exit status of 1. But the script before & after system command does run properly. Do I still need sessions? Am I looking into the right direction?
Or is this some other issue?
Thanks for replying.
I was able to figure out the error which was nothing to do with sessions. My system command was something like this:
when multiple users were tryng to run different batch files, the issue was with garbage.err file which was getting locked. I have solved the issue by using different names for these garbage.err files for different batch files.
I am planning refine this fix and use session id's for these file names.
But I am stuck with another issue now. If, from a single computer I try to run more than two different batch files by submitting the form more than two times, nothing happens at the third submit (No batch file runs). The browser just hangs, the IE progress bar does not display anything, untill any any one of the batch file's initiated earlier completes. If one of the batch files intitiated earlier takes a lot of time to complete the third submit just times out.
In summary, the perl-cgi script can have only 2 parallel runs, and I think this also means that the script will not support more than 2 users at a time.
Is there some kind of configuration setting in Apache server to let multiple instances of .pl script to run simultaneously?
The form submit code is as below:
<FORM METHOD="GET" action="http://server name/test_cgi.pl" TARGET="_blank">
I am also using the following piece of code at the beginning of the script to prevent the output of the batch run from being displayed on browser:
open(STDERR, "> E:\\Temp\\calcconsole\\output.err");
Any pointers will be appreciated.