summaryrefslogtreecommitdiffstats
path: root/funtools/tperl.c
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-26 21:13:00 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-26 21:13:00 (GMT)
commitda2e3d212171bbe64c1af39114fd067308656990 (patch)
tree9601f7ed15fa1394762124630c12a792bc073ec2 /funtools/tperl.c
parent76b109ad6d97d19ab835596dc70149ef379f3733 (diff)
downloadblt-da2e3d212171bbe64c1af39114fd067308656990.zip
blt-da2e3d212171bbe64c1af39114fd067308656990.tar.gz
blt-da2e3d212171bbe64c1af39114fd067308656990.tar.bz2
rm funtools for update
Diffstat (limited to 'funtools/tperl.c')
-rw-r--r--funtools/tperl.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/funtools/tperl.c b/funtools/tperl.c
deleted file mode 100644
index 485fafe..0000000
--- a/funtools/tperl.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- http://search.cpan.org/~nwclark/perl-5.8.7/pod/perlembed.pod
- gcc -o tperl tperl.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
- */
-
-#include <EXTERN.h> /* from the Perl distribution */
-#include <perl.h> /* from the Perl distribution */
-
-static PerlInterpreter *my_perl; /*** The Perl interpreter ***/
-
-int main(int argc, char **argv, char **env)
-{
- STRLEN n_a;
- char *embedding[] = { "", "-e", "0" };
-
- PERL_SYS_INIT3(&argc,&argv,&env);
- my_perl = perl_alloc();
- perl_construct( my_perl );
-
- perl_parse(my_perl, NULL, 3, embedding, NULL);
- PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
- perl_run(my_perl);
-
- /** Treat $a as an integer **/
- eval_pv("$a = 3; $a **= 2", TRUE);
- printf("a = %d\n", SvIV(get_sv("a", FALSE)));
-
- /** Treat $a as a float **/
- eval_pv("$a = 3.14; $a **= 2", TRUE);
- printf("a = %f\n", SvNV(get_sv("a", FALSE)));
-
- /** Treat $a as a string **/
- eval_pv("$a = 'rekcaH lreP rehtonA tsuJ'; $a = reverse($a);", TRUE);
- printf("a = %s\n", SvPV(get_sv("a", FALSE), n_a));
-
- perl_destruct(my_perl);
- perl_free(my_perl);
- PERL_SYS_TERM();
-}