RE: using perl in a c code

2003-12-04 Thread Dan Muey
> Dan Muey wrote: > > > > On Dec 1, 2003, at 6:22 AM, Ramprasad A Padmanabhan wrote: [..] > > > > Instead Can I just embed this perl code in my c > program I will be > > > > happy if someone can give some links to examples > > > on the net > > > > > >

RE: using perl in a c code

2003-12-04 Thread Dan Muey
> On Wed, Dec 03, 2003 at 05:17:01PM -0600 Dan Muey wrote: > > > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! > > In order to make your C code more portable across several > versions of the perlapi, you could use Devel::PPPort. > > perl -MDevel::PPPort -eDevel::PPPort::WriteFil

RE: using perl in a c code

2003-12-04 Thread Dan Muey
> On Dec 3, 2003, at 3:17 PM, Dan Muey wrote: > [..] > > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! > > just wait until you have to remember, > > did this work with gcc2.X or only with gcc3.Y... > and how exactly did I get it to build for the DogBertOS??? > > Before yo

RE: using perl in a c code

2003-12-04 Thread Dan Muey
> Dan Muey wrote: > > [snip] > > > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! Great! > > Awesome! Perfect! One little catch now is it'd be nice to just do > > ./test or ./test name=value&name2=val2 instead of ./test -e '' > > Or ./test > > > > this can easily be solve by addin

Re: using perl in a c code

2003-12-04 Thread Tassilo von Parseval
On Wed, Dec 03, 2003 at 05:17:01PM -0600 Dan Muey wrote: > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! In order to make your C code more portable across several versions of the perlapi, you could use Devel::PPPort. perl -MDevel::PPPort -eDevel::PPPort::WriteFile will create pp

Re: using perl in a c code

2003-12-03 Thread R. Joseph Newton
Dan Muey wrote: > > On Dec 1, 2003, at 6:22 AM, Ramprasad A Padmanabhan wrote: > > [..] > > > Instead Can I just embed this perl code in my c program > > > I will be happy if someone can give some links to examples > > on the net > > > > > > Tha

Re: using perl in a c code

2003-12-03 Thread drieux
On Dec 3, 2003, at 3:17 PM, Dan Muey wrote: [..] Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! just wait until you have to remember, did this work with gcc2.X or only with gcc3.Y... and how exactly did I get it to build for the DogBertOS??? Before you get too lost, you

RE: using perl in a c code

2003-12-03 Thread david
Dan Muey wrote: [snip] > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! > Great! Awesome! Perfect! One little catch now is > it'd be nice to just do ./test or ./test name=value&name2=val2 instead of > ./test -e '' > Or ./test > this can easily be solve by adding: char* nothing[] =

RE: using perl in a c code

2003-12-03 Thread Dan Muey
> Dan Muey wrote: > > [snip] > > > /* From David > >printf("%s",SvPV_nolen(eval_pv(perlcode,0))); > > at compile: > > cc -o perlemb perlemb.c `perl -MExtUtils::Embed -e ccopts -e ldopts` > > /tmp/ccTi5bTD.o: In function `main': > > /tmp/ccTi5bTD.o(.text+0x77): undefined reference to `eval_pv

RE: using perl in a c code

2003-12-03 Thread david
Dan Muey wrote: [snip] > /* From David >printf("%s",SvPV_nolen(eval_pv(perlcode,0))); > at compile: > cc -o perlemb perlemb.c `perl -MExtUtils::Embed -e ccopts -e ldopts` > /tmp/ccTi5bTD.o: In function `main': > /tmp/ccTi5bTD.o(.text+0x77): undefined reference to `eval_pv' > /tmp/ccTi5bTD.o(.

RE: using perl in a c code

2003-12-03 Thread Dan Muey
Thank yu Tassilo and David for your insights!! > > > Maybe I can also point you to [EMAIL PROTECTED] If you want > to do the occasional XS or embedding, this mailing-list is > the right place to consult. I may do that, thanks! Ok heres what #include #include static PerlInterpreter *my_p

RE: using perl in a c code

2003-12-03 Thread Dan Muey
> > [panda]# perl ${PATH}/xsubpp -v > xsubpp version 1.9507 > finally, i am VERY surprise that your code: > > >const char *perlcode = "use CGI 'header';print header();print 'hello > World';"; > > will work at all. the reason being is that the Perl > interpreter you create > with: > > > st

Re: using perl in a c code

2003-12-03 Thread Tassilo von Parseval
On Wed, Dec 03, 2003 at 11:33:53AM -0600 Dan Muey wrote: > Ok, I can compile this example with: > cc -o perlemb perlemb.c `perl -MExtUtils::Embed -e ccopts -e ldopts` > > I can run it like this: > ./perlemb -e 'print "Howdy";' > Howdy > Or > ./perlemb > print "Howdy"; > > Howdy > > Here's wha

RE: using perl in a c code

2003-12-03 Thread david
Dan Muey wrote: [snip] > > perlemb.c:18: macro `SvPV' used with just one arg > > So I tried it as > printf("%s", SvPV(eval_pv(perlcode),n_a)); > Which is how it was in another example and got: you don't need to supply n_a if you are not intested in the length of the SV, Perl has another api f

RE: using perl in a c code

2003-12-03 Thread Dan Muey
Thanks for the info. > On Dec 3, 2003, at 7:06 AM, Dan Muey wrote: > > > 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. > > Sorry for panicking Early >

Re: using perl in a c code

2003-12-03 Thread drieux
On Dec 3, 2003, at 7:06 AM, Dan Muey wrote: 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. Sorry for panicking Early Technically I can understand the Intellectual I

RE: using perl in a c code

2003-12-03 Thread Dan Muey
> > Can you once more explain why you want a C program that > executes Perl code given as a string? Mainly learning purposes to better my mind > And how should the Perl > code be injected into the C program? To illustrate it in Perl: $perlcode = q(print "monkey";); eval $perlcode; Excpet in C

Re: using perl in a c code

2003-12-03 Thread Tassilo von Parseval
On Wed, Dec 03, 2003 at 09:35:54AM -0600 Dan Muey wrote: > > On Tue, Dec 02, 2003 at 05:40:14PM -0600 Dan Muey wrote: > > > > > What I was wondering about was how to execute some perl > > code *inside* > > > the c program instead of takign it via ARGV. I think eval_pv and > > > eval_sv have som

RE: using perl in a c code

2003-12-03 Thread Dan Muey
> On Tue, Dec 02, 2003 at 05:40:14PM -0600 Dan Muey wrote: > > > What I was wondering about was how to execute some perl > code *inside* > > the c program instead of takign it via ARGV. I think eval_pv and > > eval_sv have somethgin to do with it but I'm a bit cloudy > there. Since > > I don't

RE: using perl in a c code

2003-12-03 Thread Dan Muey
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

Re: using perl in a c code

2003-12-03 Thread Tassilo von Parseval
On Tue, Dec 02, 2003 at 05:40:14PM -0600 Dan Muey wrote: > What I was wondering about was how to execute some perl code *inside* > the c program instead of takign it via ARGV. I think eval_pv and > eval_sv have somethgin to do with it but I'm a bit cloudy there. > Since I don't know hardly anyth

Re: using perl in a c code

2003-12-02 Thread drieux
On Dec 2, 2003, at 3:40 PM, Dan Muey wrote: [..] What Id' really like to be able to do is compile it as simplepage.cgi and see if I can get it to do me a little page: http://www.whatever.com/simplepage.cgi Or http://www.whatever.com/simplepage.cgi?name=waldo This is a very cool idea, I'd love to be

RE: using perl in a c code

2003-12-02 Thread Dan Muey
> On Dec 1, 2003, at 6:22 AM, Ramprasad A Padmanabhan wrote: > [..] > > Instead Can I just embed this perl code in my c program > > I will be happy if someone can give some links to examples > on the net > > That is very very sexxy! I was rea

Law of Kharma - was Re: using perl in a c code

2003-12-02 Thread drieux
On Dec 2, 2003, at 6:58 AM, Andrew Gaffney wrote: Ramprasad A Padmanabhan wrote: I choose to write code in perl , unless I am forced to write it in C , either because my system just hangs if I use perl ( like some threaded applications ) or because my BOSS wants so ;-) That's why its nice to hav

RE: using perl in a c code

2003-12-02 Thread Dan Muey
> Ramprasad A Padmanabhan wrote: > > I choose to write code in perl , unless I am forced to > write it in C , > > either because my system just hangs if I use perl ( like some > > threaded applications ) or because my BOSS wants so ;-) > > That's why its nice to have a not-too-techie boss. I j

Re: using perl in a c code

2003-12-02 Thread Andrew Gaffney
Ramprasad A Padmanabhan wrote: I choose to write code in perl , unless I am forced to write it in C , either because my system just hangs if I use perl ( like some threaded applications ) or because my BOSS wants so ;-) That's why its nice to have a not-too-techie boss. I just throw all sorts of j

Re: using perl in a c code

2003-12-02 Thread Ramprasad A Padmanabhan
On Tue, 2003-12-02 at 15:56, Manish Uskaikar wrote: > I am a student of perl, who is amazed by the power of perl, when it comes to > regular expressions. I have learned Omnimark / flex and many other tools, > but found that Perl is better than all(This is my personal opinion). Let me > assure the

Re: using perl in a c code

2003-12-02 Thread Manish Uskaikar
ROTECTED]> To: "Robert Brown" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, December 02, 2003 11:33 AM Subject: Re: using perl in a c code > On Mon, 2003-12-01 at 22:02, Robert Brown wrote: > > > Sounds like you are trying to write a harvesting tool

Re: using perl in a c code

2003-12-01 Thread Robert Brown
Ramprasad A Padmanabhan writes: > On Mon, 2003-12-01 at 22:02, Robert Brown wrote: > > > Sounds like you are trying to write a harvesting tool to build a > > spammer's email address list to me. Since you want to do it in C, I > > suspect that either you have a huge amount of text to parse, p

Re: using perl in a c code

2003-12-01 Thread Ramprasad A Padmanabhan
On Mon, 2003-12-01 at 22:02, Robert Brown wrote: > Sounds like you are trying to write a harvesting tool to build a > spammer's email address list to me. Since you want to do it in C, I > suspect that either you have a huge amount of text to parse, probably > from web pages and news group posting

Re: using perl in a c code

2003-12-01 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: > > I am writing a c program In which I have some heavy text parsing to do. > Unfortunately I am not very conversant with C or Regex in C You can use Perl's regular expressions in C: http://www.regular-expressions.info/pcre.html > I have read about embedding perl

Re: using perl in a c code

2003-12-01 Thread david
Ramprasad A Padmanabhan wrote: > I am writing a c program In which I have some heavy text parsing to do. > Unfortunately I am not very conversant with C or Regex in C > > I have read about embedding perl into C programs, > > Now How Can I do this efficiently > > Suppost I want to parse a Mail T

Re: using perl in a c code

2003-12-01 Thread drieux
On Dec 1, 2003, at 6:22 AM, Ramprasad A Padmanabhan wrote: [..] Instead Can I just embed this perl code in my c program I will be happy if someone can give some links to examples on the net HTH. ciao drieux --- -- To unsubscribe, e-mail: [EMAI