By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

System calls;

P: 27
Hi There,
I have a C program that needs to call a Perl program and run it. Also I need to pass some variables to that Perl file from C. I tried to use system("filename.pl") but it's not working. What I'm I missing here? I need to open that .pl file and run it and then run the rest of the C code. Please help me out.

Thank you.

Palm.
Mar 12 '07 #1
Share this Question
Share on Google+
4 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
Hi There,
I have a C program that needs to call a Perl program and run it. Also I need to pass some variables to that Perl file from C. I tried to use system("filename.pl") but it's not working. What I'm I missing here? I need to open that .pl file and run it and then run the rest of the C code. Please help me out.

Thank you.

Palm.
If you're in a linux system, try:
Expand|Select|Wrap|Line Numbers
  1. system("perl filename.pl");
  2.  
(I think this will work with windows, but I'm not sure)
Mar 12 '07 #2

DeMan
100+
P: 1,806
pretty sure it works in windows (of course perl has to be in the current path)
Mar 12 '07 #3

sicarie
Expert Mod 2.5K+
P: 4,677
pretty sure it works in windows (of course perl has to be in the current path)
Right. And in Linux, to circumvent, you can prepend the statement with ./ - which means run in current directory.
Mar 12 '07 #4

P: 27
Hi Sicarie & DeMan,
Thanks a lot for your great help. It's working now.

Palm.
Mar 14 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.