Feb 19, 2008, 8:58 AM
Post #1 of 4
Hi all, this is my first thread here... I have been trying to find solutions through internet but found nothing related to this issue and I finally made a google search for "perl forums" and joined the first one.
Problems with closing a filehandle work which should run remotely
I have been programming perl for 3 years, but this is the 1st time I am in need of something like this.
I have a server which sends the post information to a perl CGI script. It digests the data and opens a filehandle to a third party perl program which last like 2 days to finish (it manages a lot of information).
My idea here was to just send the program call, and after, send an e-mail to the user saying "hey, everything was OK and you will receive an e-mail" via sendmail.
The problem is that I have no clue on how to call my program remotely.
My actual code for this is:
open (MODLINK, "-|", $modlink_call) || (&eRROR_webpage and print "<b>Error while bla bla bla" and &eRASE_submitted_files and exit (-1));
if ($_ eq "ModLink is running...")
print "<b>Everything is ok bla bla bla you will be send an e-mail";
I don't know if this is the best way, but this is how I have done my servers all my life (remember, only 3 years).
It is supposed to call ModLink.pl , which the first line it returns is "ModLink is running..." and then close both the filehandle first then the connection between the client and the server... but it doesn't... It send the msg saying "<b>Everything is ok... [..]" once the process finishes...
Any insight here?
Thank you in advance.