Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Does anyone know how to run a C++ program from PeRl? Like what is the syntax involved. And, how to send an entire textfile to the MAIL pipeline?
Thanks,
Joe
O, if anyone can recommend a good beginners to PERL book but not programming that would be great too thanks much.

To run an external program from Perl, you use the exec() or system() functions. The fist one will end/exit the Perl script and run the external command and the second will pause the Perl script while the external command is running.
exec "rm *.bak";
system "rm *.bak";You can also use backquotes to capture the output of an external command.
$now = `date`;
@dir = `ls`I'm not sure what you mean by "a good beginners to PERL book but not programming". Perl is a scripting/programming laungage so you won't be able to find a Perl book that doen't envolve programming. Take a look at (O'Reilly) Learning Perl by Randal Scwartz & Tom Phoenix. It a very good beginners Perl book. Also look at Perl in a Nutshell, and Programming Perl. http://perl.oreilly.com/

Hi,
Thank you very much. Woops, missed type that I meant a Perl book for beginners but not to programming.
Ill look into those books you recommended.
Best,
Joseph

Ok. I got the program to run but it doesnt actually run the program. The text appears but none of the analyzes output is done.
I am running a c++ program from a perl script in windows XP.thanks,
joseph

Which of these are you saying:
a) The Perl script is not executing the c++ program.
b) The c++ program is not producing output.
c) Perl is not capturing the output of the c++ program.
Can you post or email me the script, at least, starting with the portion that calls the c++ program through the portion that accepts its output?
This is a poor forum for posting code because it doesn't easily allow the posting of certain types of code fragments. Also I never receive notification when you responded to my posting. www.experts-exchange.com is much better for this purpose.

![]() |
Need difference
|
Need help 2 develop my C+...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |