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

calling a C program from perl

Status
Not open for further replies.

xiaoleiqq

Programmer
Aug 30, 2006
43
US
I am currently working on connecting a C program with perl, but have no idea where to start.
The idea is perl will invoke the C program (an executable file) with certain parameters(just like the linux shell did), and leave the program running alone and finished.

Please give any suggestions, THank you.
 
What od you mean by "leave the program running alone and finished"?

Can you just use the system command:

Code:
   @args = ("command", "arg1", "arg2");
    system(@args) == 0
         or die "system @args failed: $?"

[code]

If you want to leave the C program running just have "&" as your last arg.

HTH

If at first you don't succeed, don't try skydiving.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top