Solved

Convert PERL to C or C++...

Posted on 2002-03-22
8
5,130 Views
Last Modified: 2010-05-18
I need translate a code from PERL to C or C++.
Where can I found a tool for help me the translation ?
0
Comment
Question by:grava_cd
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 5

Accepted Solution

by:
Sapa earned 100 total points
ID: 6889237
try to type:

perldoc perlcc

and read this document.

Andrey
0
 

Author Comment

by:grava_cd
ID: 6891444
Hi !

Thanks...
I try many times use the perlcc, but the C code is dependent of the perl56.lib and anothers modules..
and dont run ... dont correct translate the code...
:-(
0
 
LVL 5

Expert Comment

by:Sapa
ID: 6892529
perl56.lib is just a Perl interpreter library. In activestate distribution it's named bin/perlcore.dll
Unfortunately it's impossible to translate Perl to C and does not link binary with Perl interpreter.
0
 
LVL 5

Assisted Solution

by:Peewee
Peewee earned 100 total points
ID: 6893827
grava_cd,
the perlcc function will turn your perl into c code using perl libraries.

As Perl is written in c, it is actually doing stage one in execution, ie turning perl into c and then it will run the c program.

Hence it will never be a perfect translation into a nice c program, as it will always have a perl emphasis within the c code.

The best way to get c or C++ code from perl is unfortunately to re-write it in c/c++.  Here's a good article for you:

http://www.perl.com/pub/a/2001/06/27/ctoperl.html

regards
Peewee
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 5

Expert Comment

by:Peewee
ID: 6893840
grava_cd,
i forgot to mention the emphasis of the document is why not to bother compiling your perl into c.

regards
Peewee
0
 

Author Comment

by:grava_cd
ID: 6899022
Thanks...

Do you know where can I found a library or C++ source for help me the source convertion ?

Libraries for simulate the PERL Hashes, Arrays in C...
with this feature, I thing is more easy for manually converting the sources.

Thanks
0
 
LVL 5

Expert Comment

by:Peewee
ID: 6899225
0
 
LVL 8

Expert Comment

by:inq123
ID: 9490759
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split b/w Peewee and Sapa

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

inq123
EE Cleanup Volunteer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now