Author |
Message |
rizzix
|
Posted: Sun Nov 30, 2003 5:22 pm Post subject: ActivePerl -- getting output of external programs |
|
|
ok this is really annoying.. i can't get any output from any program i execute through a perl script using acitve perl.. have u guys tried this.. if u were successful.. how did u do it?
note: everytime i tried doing this, the program i executed always prints to the console. how annoying! And the variable to which i'm storing the output to, is empty! ![Evil or Very Mad Evil or Very Mad](images/smiles/icon_evil.gif) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
octopi
![](http://compsci.ca/v3/uploads/user_avatars/1246682444a1aa25749124.gif)
|
Posted: Mon Dec 01, 2003 10:24 pm Post subject: (No subject) |
|
|
what code are you using to run the command?
most things will return the return value of the program.
$theoutput = `echo hello`;
should = "hello" |
|
|
|
|
![](images/spacer.gif) |
rizzix
|
Posted: Wed Dec 03, 2003 1:56 am Post subject: (No subject) |
|
|
hmm, odd, echo appears to works. so does ipconfig.exe
javac does not work.. i guess perl (or maybe jsut ActivePerl) can't catch output from a java program? |
|
|
|
|
![](images/spacer.gif) |
octopi
![](http://compsci.ca/v3/uploads/user_avatars/1246682444a1aa25749124.gif)
|
Posted: Wed Dec 03, 2003 9:55 am Post subject: (No subject) |
|
|
it could be a STDERR, STDOUT problem.
Try redirecting STDERR to STDOUT, and see if that helps
(add this to the end of your command '2>&1' pretty sure thats it, and I'm pretty sure this works in 'nix, and windows) |
|
|
|
|
![](images/spacer.gif) |
rizzix
|
Posted: Wed Dec 03, 2003 4:09 pm Post subject: (No subject) |
|
|
woot thanks .. works.. |
|
|
|
|
![](images/spacer.gif) |
|