![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling Winzip from perl script | MobileUser | Shell Programming and Scripting | 5 | 04-04-2007 12:51 AM |
| calling a shell script from perl | gurukottur | Shell Programming and Scripting | 3 | 10-05-2006 08:48 AM |
| Perl calling unix system commands | new2ss | Shell Programming and Scripting | 4 | 04-05-2006 06:32 PM |
| URL calling in PERL | DeepakXavier | Shell Programming and Scripting | 1 | 01-04-2006 08:29 AM |
| Calling perl modules from shell scritps | kavitha | Shell Programming and Scripting | 1 | 03-31-2004 11:34 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I am trying to execute a perl script from c program. I tried using system command. system("perl test.pl filename") ; This perl program takes filename as input and prints a number to screen. I need to get that returned number in C program. system command is executing perl program, but I am not able to get the return number. How I can get the return value in c. Thanks, kk. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi!
Two simple ways of getting the output are: 1.) system("perl test.pl filename > output.txt"); ----> and then open the file output.txt and read it for the output. 2.) popen("perl test.pl filename", "r"); and read the output, which is the method I suggest. ----> See the man pages of popen() Rgds SHAIK |
|
#3
|
|||
|
|||
|
u dont even need to use
system("perl test.pl filename") ; better put the first line of your PERL file as #!/usr/bin/perl then u can directly use system("test.pl filename >output") and then read from this output file |
|||
| Google The UNIX and Linux Forums |