Don't get me wrong, I have no practical reason for running website stuff from C. I
think it may be valueable to know at some point and would be a terrific learning
experience.
> Now as for the code fragment:
Which is a Perl example of what I think would be cool to be able to do with C...
>> my $perlcode = <<CODE;
use CGI qw(header param);
# opps should have had this here, sorry
>> # instead of getting this via command line argument
>> sub simplepage {
#oops I meant to have gotten all that return()ed it instead of
print()ed...
>> my $name = shift || 'world';
>> #use CGI qw(header param); # moved this to above
>> print header()
>> print "I am perl hear me roar $name\n";
>> print insult();
return header()."I am perl hear me roar $name\n".insult();
# there that's what I meant instead of the print statements
>> }
>> sub insult { return "So is ytour mother\n"; }
>> return simplepage(param('name'));
>> CODE
>>
>> printf eval_pv($perldoc);
where printf and evl_pv is the c code I need to output the return value of the code
$perlcode
> what happens when the simple.cgi is called without arguments?
> eg: if there is no 'name' in the parameter list???
That what the shift || 'world' is for.
> More importantly, how are you planning to differenciate between say a
> 'POST' request, a 'HEAD' request, and a 'GET' request.
CGI moduile does it for me! (Which I had in the wrong place)
I think the use of CGI and webpageish environment clouded my question.
What I'd like to see if can be done is this:
Put some perl code, that if run from a command line or browser or whatever
with or with our input of some sort would output some ascii text,
Inside of C program, probably as avariable I'm guessing then use
C to execute it and take what it outputs and , well oout put it.
Like I said NO: 'I'm goanna replace Perl/mod_perl' SIMPLY, purley an
educational project that I think may help me learn somethgin.
Thanks
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]