Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 ActivePerl -- getting output of external programs
Index -> General Discussion
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rizzix




PostPosted: 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 Evil or Very Mad
Sponsor
Sponsor
Sponsor
sponsor
octopi




PostPosted: 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"
rizzix




PostPosted: 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?
octopi




PostPosted: 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)
rizzix




PostPosted: Wed Dec 03, 2003 4:09 pm   Post subject: (No subject)

woot thanks .. works..
Display posts from previous:   
   Index -> General Discussion
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: