Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture output from system call 1

Status
Not open for further replies.

CJason

Programmer
Oct 13, 2004
223
US
I have a script and am wanting to run:

`perl -c $perl_file`
and
`perl -wc $perl_file`

and capture the output (preferably in an array). I've tried:

@resp = `perl -c $perl_file`;

with no luck! Any ideas?

Thanks much!
 
Steve...Dude....YOU DA MAN!!!

Thanks Steve & Kevin!
 
You ARE the man Steve. I have been racking my brain since this was posted trying to figure it out. Very nice.
 
I knew you could redirect STDERR to STDOUT under *nix, but I didn't know if it worked on Windows. Happily, it does...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top