Mixing code in C and Perl


 
Thread Tools Search this Thread
Top Forums Programming Mixing code in C and Perl
# 1  
Old 07-20-2009
Mixing code in C and Perl

Hi there,

if you want to write an application partly in C and partly in Perl and have a final executable binary is it possible to do so. If yes, how ?

My motivation for asking this question is that there are certain tasks that are so tedious to write in C while it can be taken care of in Perl in like 20 lines of code ! Hence i would like to have a hybrid source (partly C, partly perl) yet still be able to generate a binary executable in the end.

Any suggestions ?
# 2  
Old 07-20-2009
If you want to write it in Perl, why write it in C?

You can use libperl++ to call some Perl things from C++ but that amounts to dragging around a full-fledged Perl interpreter with you wherever you go...
# 3  
Old 07-21-2009
You could write it in Perl, with Low-level calls (if not already available) written in C through the XS interface
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

Perl -- code

Hi All, I new to perl scripting, trying to write a program to get multiple inputs from the users and it should be stored in one variable. can some one help me with it . here is the sample code i tried , but its not working. # cat array.pl #!/usr/bin/perl print "enter the total no of... (4 Replies)
Discussion started by: nanduri
4 Replies

2. Shell Programming and Scripting

perl code

What is the meaning of below code, which is capturing from one file . $runDate = $1 if $str =~ m/,"TransactTime":"({10})/; # get transaction date as run date Is it the date from the first line of file or last line of file??? (Note:Each line from the file contains date) (2 Replies)
Discussion started by: aish11
2 Replies

3. Shell Programming and Scripting

perl code

Perl code to get the diff of the two baselines in clearcase ? (2 Replies)
Discussion started by: saku
2 Replies

4. Programming

Perl- How to catch the file in perl code?

Hi, plz see the below code , i have catch the file "Orders.20110714.out "file as a Orders*.out. but it giving me an error .it does not open the file. if the same thing i have done by code code-> ls Orders*.out then it gives me the output Orders.20110714.out i am trying apply the... (1 Reply)
Discussion started by: pspriyanka
1 Replies

5. Shell Programming and Scripting

perl: a way to see a sub code in debug mode: perl -de 0 ?

Is there a way to see or print a sub code? Sometime a sub could be already defined, but in the debug mode (so, interactively) it could be already out of screen. So, I would think about a way to check if the sub is defined (just 'defined' is not a problem) and how it is defined. Also, if... (4 Replies)
Discussion started by: alex_5161
4 Replies

6. Shell Programming and Scripting

Mixing Perl with Bash

I am fiddling with a little script that will issue a shutdown command if the temperature on the CPU goes above a certain level. I started writing the script in Bash, and then thought I would like to use Perl to extract the detailed bits, but I am not sure if this is really practical. Basically I... (2 Replies)
Discussion started by: kermit
2 Replies

7. UNIX for Dummies Questions & Answers

perl code help

if anyone knows how to do the loop and the function listed, please let me know it would be a great help. Thanks! •Create an array NUM with the following ten values in it: 14, 25.6, 43, 22, 412.14, 819, 2, 721, 7.218, 11.9 •Print the array NUM •Create an array COLOR with the following... (1 Reply)
Discussion started by: circleW
1 Replies
Login or Register to Ask a Question