It's better not to put this stuff into mod_perl because you'll have issues with memory 
etc. And the time you gain is nothing to compare with the time needed
to start external process.

Put it in regular CGI script. And to catch output from external program
use standart methods like backticks, pipe, etc. If you need to provide some
input to that external program then you may want to use the following method.


$pid = open(IN, "-|");
if($pid == 0){ #child, STDOUT -> parent
   open(OUT, "|external_program");
   print OUT @stuff_for_external_program;
   close(OUT); # wait for it to finish;
   exit 0;
}
@from_external_program = <IN>;
  
Add child reaper and you should be all set.

Andrei

On Tue, Dec 07, 1999 at 01:53:20AM -0800, hamid khoshnevis wrote:
> I am trying to call Glimpse from modperl and capture the data set back.  
> After I wrote the email, I was told by a friend that I should use temporary 
> files to capture the output of Glimpse.
> 
> Any ideas??
> 
> hamid
> 
> 
> >From: "G.W. Haywood" <[EMAIL PROTECTED]>
> >To: mod_perl Mailing List <[EMAIL PROTECTED]>
> >Subject: System calls to return data via STDOUT
> >Date: Mon, 6 Dec 1999 19:01:23 +0000 (GMT)
> >
> >Hi all,
> >
> >On Sun, 5 Dec 1999, hamid khoshnevis <[EMAIL PROTECTED]> wrote:
> >
> > > I am a newbie modperl'er
> >
> >Welcome to the club.
> >
> > > I am tyring to get system calls to return data to modperl (via stdout).
> >
> >The idea of mod_perl is to get things to go faster by avoiding as much
> >as possible the (time consuming) launching of new processes and things
> >like that.  Are your system calls launching new processes?  If so, you
> >may not be getting the benefits of mod_perl but you'll be getting the
> >disadvantages (huge memory consumption to name but a few).
> >
> >What is making the system calls and why?
> >Is There More Than One Way To Do It?
> >
> >73
> >Ged.
> >
> 
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com

-- 

Reply via email to