M
mike
Hi Guys:
I have an Email application that was made of C(no source code). Only I
know is that it can call a program with a parameter(email file name)
and check the return value. If returns 0, go ahead and work with the
next one; return 1, drop it, and work with next one.
I intend to use Perl script to check the email's FROM field. Once it
comes from a specific domain, then return 1; otherwise, return 0.
Here comes the question: How can I return 0 or 1 from Perl script to
the C program? I made a C test program, and called the Perl script
this way:
int ret_val = system("perl_script email_file_name");
When I call exit(0) in the Perl script, the ret_val in the C test
program is 0; but when I call exit(1) in the Perl script, the ret_val
in the C test program is 256,
How come it happens this way? Any suggestion would be appreciated.
Mike
I have an Email application that was made of C(no source code). Only I
know is that it can call a program with a parameter(email file name)
and check the return value. If returns 0, go ahead and work with the
next one; return 1, drop it, and work with next one.
I intend to use Perl script to check the email's FROM field. Once it
comes from a specific domain, then return 1; otherwise, return 0.
Here comes the question: How can I return 0 or 1 from Perl script to
the C program? I made a C test program, and called the Perl script
this way:
int ret_val = system("perl_script email_file_name");
When I call exit(0) in the Perl script, the ret_val in the C test
program is 0; but when I call exit(1) in the Perl script, the ret_val
in the C test program is 256,
How come it happens this way? Any suggestion would be appreciated.
Mike