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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running perl script from c++ program?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i have written a perl script to perform an ftp download automatically, so that is great. however, i would like to execute this perl script from a c++ program. any idea how i might do that? somehow i need to issue a command to the system? thanks for any help
-scott
 
Scott, hi.

The system() command is the one you want.

If you're on a UNIX system you can probably just do:

system("/path/to/script/script_name.pl");

and that might work on WinXX and NT and 2000 as well, if you have the .pl extension accociated with perl.exe (what happens when you double click on a .pl file in explorer? if it runs as a perl script it is associated correctly) if not you could try:

system("\\path\\to\\perl\\perl.exe \\path\\to\\script\\script_name.pl")
------------------------------------------------------------------------
Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
good :)

there's a horrendously complicated (to me at least) way of having a perl interpreter linked in as part of your execuatable -- details in perlguts (I think) if you're interested...... Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top