masala_curry has asked for the wisdom of the Perl Monks concerning the following question:
I have a C program say cProg.c that asks the user to enter a filename, (opens that file and operates over it) and saves the output in a file "output.txt"
#include< stdio.h> main (int argc, char *argv[]) { FILE *fp; if (argc!= 2) printf ("Please Enter a FileName\n"); else { fp = fopen (argv[1], "r"); printf ("File Found\n"); fclose (fp); } return 0; }
===============mail.pl ENDS====================#!/usr/bin/perl ./a.out input.txt > output.txt ###How should I do this? $output_file="output.txt"; open(OP, $output_file) || die("Could not open file!"); @sequence=<OP>; # tosses the contents of "output.txt" in an array +"@sequence" to work on.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to run C object code in PERL
by tilly (Archbishop) on Apr 04, 2009 at 04:18 UTC | |
by masala_curry (Novice) on Apr 04, 2009 at 04:53 UTC | |
|
Re: How to run C object code in PERL
by gwadej (Chaplain) on Apr 04, 2009 at 04:15 UTC | |
|
Re: How to run C object code in PERL
by Bloodnok (Vicar) on Apr 04, 2009 at 12:55 UTC | |
by masala_curry (Novice) on Apr 04, 2009 at 19:44 UTC |