Hi Jose,
Thanks for your suggetion. I already tried this erlier
and once again.

It does not work. I tried following example. Any other
suggestions.
------------------
#include <stdio.h>
int main()
{
 printf"Returning 100\n";
 return 100;
}
------------------
$gcc ret_100.c

-------------------------
#!/usr/bin/perl -w
my $ret_val = `./a.out`;
print "AC::", $ret_val, "\n";
--------------------------

Thanks and regards
Ambikesh

--- Jose Nyimi <[EMAIL PROTECTED]> wrote:
> > -----Message d'origine-----
> > De : Ambikesh Chaurasia
> [mailto:[EMAIL PROTECTED] 
> > Envoyé : dimanche 10 avril 2005 18:30
> > À : perl
> > Objet : Capturing the integer return value of a
> "C" program, 
> > called inside perl script
> > 
> > 
> > Hi Guys,
> > 
> > I want to capture the return value of a "C"
> program
> > called inside a perl script. How to do this??
> > 
> > Let say I have a "C" program named "val_100.c" .
> > 
> > //val_100.c
> > #include <stdio.h>
> > int main()
> > {
> >   return 100;
> > }
> > 
> > I want to call this program from a perl script and
> > want to store the return value "100" in the perl
> > script. (Please note that I do not want to capture
> the
> > running status of the program).
> > 
> > Please guide me how to do this in a perl script.
> 
> perldoc -q backticks
> 
> my $ret_val = `c_prog_call`;
> 
> HTH,
> José.



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to