Re: Perl Scripting help

2001-09-26 Thread Brian Reichert

On Thu, Sep 27, 2001 at 09:22:41AM +1000, Matthew Blacklow wrote:
> I am writing a script at the moment which among others things creates
> another process using the system call.
> What I need to do is capture the screen output of this process into a string
> variable so that it can latter be manipulaterd. ie. capture the STDOUT.

This isn't the right forum for this, really, but assuming you mean
STDOUT/STDERR, consider this:

  

> Any help, suggestions or sample code would be appreciated.
> 
> Thanks,
> Matthew

-- 
Brian 'you Bastard' Reichert<[EMAIL PROTECTED]>
37 Crystal Ave. #303Daytime number: (603) 434-6842
Derry NH 03038-1713 USA Intel architecture: the left-hand path



Re: Perl Scripting help

2001-09-26 Thread Ken Y. Clark

On Thu, 27 Sep 2001, Matthew Blacklow wrote:

> Date: Thu, 27 Sep 2001 09:22:41 +1000
> From: Matthew Blacklow <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Perl Scripting help
>
> I am writing a script at the moment which among others things creates
> another process using the system call.
> What I need to do is capture the screen output of this process into a string
> variable so that it can latter be manipulaterd. ie. capture the STDOUT.
>
> Any help, suggestions or sample code would be appreciated.
>
> Thanks,
> Matthew

Matthew,

This isn't the right forum for general Perl help.  Generally speaking,
you should only post mod_perl-specific questions.  If your question is
how best to capture STDOUT from an external program from within a
mod_perl program, then I might suggest you examine something like
Apache::SubProcess or just search The Guide
(http://perl.apache.org/guide) or use Google to search the web for
your answer -- all of which is not to say that you couldn't just
backtick your program and capture the output in a scalar.  There's
lots of information on this.  `perldoc perlop` and look for
"backtick," or, again, use Google to look for your answer.  Or
consider posting your question to an audience who will be more likely
to answer your question, like comp.lang.perl.misc.

ky




Re: Perl Scripting help

2001-09-26 Thread Ray Graham

You'll need to use the backticks instead of the system call.

$output = `command`;

To get each line of the output, you'll need to split off of \n.

-Ray Graham



Perl Scripting help

2001-09-26 Thread Matthew Blacklow

I am writing a script at the moment which among others things creates
another process using the system call.
What I need to do is capture the screen output of this process into a string
variable so that it can latter be manipulaterd. ie. capture the STDOUT.

Any help, suggestions or sample code would be appreciated.

Thanks,
Matthew