C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 20th, 2002, 05:10 PM
dmittner dmittner is offline
Dazed&Confused
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Tempe, AZ
Posts: 91 dmittner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 34 m 13 sec
Reputation Power: 7
Send a message via ICQ to dmittner Send a message via AIM to dmittner
Perl embedded within C

I have a number of Perl scripts spread across oh... 1000 or so servers that are currently being upgraded. Those scripts make database connections hense have somewhat sensitive information. Perl not having any form of compiling, they're sitting there in plain text.

I need to change that.

Now I could go through and re-write them all in C, but to do so would make me want to re-write all the background scripts in C which could take me the next 15 years or so at my current C compentency. So I began searching around for ways of encrypting the scripts while still allowing them to run. Enter the concept of embedding Perl in C.

My goal now is to encode the scripts in some way and run them via a C program. Like so:

- C program loads encoded script into memory
- C program decodes
- C program communicates unencoded script with Perl interpreter
- C and Perl live happily ever-after

Putting the theory into practice, however, is more difficult.

I'm currently toying with the PerlInterpreter that comes in perl.h with the Perl software. The part that I'm getting caught up on is passing the code from memory into the interpretter. I have an array that's capable of holding all the lines of code to push through, but the perl_parse function seems to only imitate the functionatlity of the 'Perl' command line interface... which seems to make the whole thing rather pointless.

In any case, is this at all possible -- be it through PerlInterpreter or some other means?

Any info is greatly appreciated.

Thanks,
Dave Mittner

Reply With Quote
  #2  
Old December 25th, 2002, 02:29 PM
Epsilon Epsilon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Long Beach, California
Posts: 86 Epsilon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 6 m 54 sec
Reputation Power: 7
I do believe that there are Perl compilers to do just what you want. I'm not a Perl guy at all, so sorry if I'm way off base.


As for your ideas, they're a little over my head, hehe

Reply With Quote
  #3  
Old December 25th, 2002, 08:46 PM
dmittner dmittner is offline
Dazed&Confused
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Tempe, AZ
Posts: 91 dmittner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 34 m 13 sec
Reputation Power: 7
Send a message via ICQ to dmittner Send a message via AIM to dmittner
Quote:
Originally posted by Epsilon
I do believe that there are Perl compilers to do just what you want. I'm not a Perl guy at all, so sorry if I'm way off base.


As for your ideas, they're a little over my head, hehe


Thanks for the reply. I got it working.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Perl embedded within C


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway