
-----------------------------------
rizzix
Sun Nov 30, 2003 5:22 pm

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:  :evil:  :evil:

-----------------------------------
octopi
Mon Dec 01, 2003 10:24 pm


-----------------------------------
what code are you using to run the command?

most things will return the return value of the program.

$theoutput = `echo  hello`;

should = "hello"

-----------------------------------
rizzix
Wed Dec 03, 2003 1:56 am


-----------------------------------
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?

-----------------------------------
octopi
Wed Dec 03, 2003 9:55 am


-----------------------------------
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)

-----------------------------------
rizzix
Wed Dec 03, 2003 4:09 pm


-----------------------------------
woot thanks .. works..
