Bill Luebkert <[EMAIL PROTECTED]> wrote: Chris Rodriguez wrote:
> Hi everyone,
> I saw the following on another PERL list-serve:
> 
> "If you are on windows, then see perlfaq8 if ActiveState perl for
> how to redirect STDOUT and STDERR when doing backticks."
> 
>  I'd like to be able to capture STDOUT as a string. But nothing on  perlfaq8 
> struck me as relevant. Did I miss something? How do I do this?  I frequently 
> get drastic errors (my computer shuts down!) when I try to  use backticks.

Did you read:

 How can I capture STDERR from an external command?

Also check out the perlop man page under:

     qx/STRING/
     `STRING`

     ...

     $output = `cmd`;
# or grab STDERR as well
     $output = `cmd 2>&1`;

Hi.  "cmd" refers to any command, right?  Neither formulation works for me.  If 
I do:
$output = `perl -c somescript.pl`;
  I see "somescript.pl syntax OK" on the screen, and the variable $output 
remains unassigned.  If I do:
  $output = `perl -c somescript.pl 2>&1`;
  I get a message saying "This program has performed an illegal operation..." 
and I have to turn off my computer.
I've had the same problem using qx too.  Could it be that I'm using PERL 5.6?
  
  Chris

 
---------------------------------
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to