MY PERLSCRIPT STOP BEFOR ITS NATURAL END

J

jutta

I use a perlscript to import data into a database. I call this script
from a WEB-based tool, written in php. The perlscript uses cgi to print
the status of the import.

It works realy pretty if there are not to mutch files to import.But if
the perlscript gets more files, it needs a long time to import, at last
up to three hours, and it will break befor end.

In php I know the configuration option "max_execution_time" in the
php.ini file. But in perl I did'nt finde anything like this.

Please can you help me, telling me why the script breaks. Do you know
wether the browser or perl is the cause of this behavour?
 
I

Ian Wilson

jutta said:
I use a perlscript to import data into a database. I call this script
from a WEB-based tool, written in php. The perlscript uses cgi to print
the status of the import.

It works realy pretty if there are not to mutch files to import.But if
the perlscript gets more files, it needs a long time to import, at last
up to three hours, and it will break befor end.

In php I know the configuration option "max_execution_time" in the
php.ini file. But in perl I did'nt finde anything like this.

Please can you help me, telling me why the script breaks. Do you know
wether the browser or perl is the cause of this behavour?

Your perl interpreter should have no problems working away for three
hours. Make sure the perl script reports errors to the browser
e.g. use CGI::Carp 'fatalsToBrowser';
I'd also use strict; use warnings;

I suspect the web-server is the source of your problem. Three hours is
just too long for a HTTP transaction. Check the server logs.

I'd think about amending the Perl CGI script to fork a background
process to do the file import (assuming the files to be imported are on
the server and not being uploaded). Then the Perl CGI script could just
report that the import process has been started. I'd have a separate
Perl CGI script to report on the currecmt state of progress ("started",
"1% done" ... "completed"). The second script could be repeatedly
called. Perhaps using meta refresh to update what the browser sees at
suitable intervals.

YMMV
 
G

Guest

: I use a perlscript to import data into a database. I call this script
: from a WEB-based tool, written in php. The perlscript uses cgi to print
: the status of the import.

: It works realy pretty if there are not to mutch files to import.But if
: the perlscript gets more files, it needs a long time to import, at last
: up to three hours, and it will break befor end.

Jutta,

make your life easier by doing some simple things:

1. Test your perl script in a shell environment (even if it uses CGI, it
can still be run from the command line).

2. Make sure your problem is really in the perl script, and not anywhere else.
If it is anywhere else (like a web server setup issue), then this is not
the right group to post. If it is indeed the perl script causing problems,
then boil it down to the minimal size exposing your problem.

3. By now, you have a good chance of identifying the problem area. If not,
post your script here, but don't forget to describe what your input looks
like (sample input is good, it can be added to your script using __DATA__),
and what kind of output you expect. Please, please, don't just say "it
doesn't work".

4. Locate the posting guidelines for this group and follow the suggestions
given there.

5. Please do not use an all-capitalized headline. It is the equivalent of
shouting. You may feel distressed because you have to deliver your work,
but nobody is going to listen to you if you shout. People here are very
generous with their good help despite being a bit terse occasionally,
but have a lot to do themselves.

Oliver.
 
J

jutta

I have a look at the errorreport and detected an error in the script!
After the workaround, I started the script again and it run to end! I'm
happy about it. Your right the cause was not perl, but the error in my
script. Because of the time problem in PHP and the fact that the
problem appears just after that long time I was blind to see the simple
cause.


Thanks for help, jutta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top