~ubuntu-branches/ubuntu/lucid/gauche-c-wrapper/lucid

« back to all changes in this revision

Viewing changes to examples/perl/perl.scm

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2008-04-07 09:15:03 UTC
  • Revision ID: james.westby@ubuntu.com-20080407091503-wu0h414koe95kj4i
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env gosh
 
2
 
 
3
(use c-wrapper)
 
4
 
 
5
(c-load-library "/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE/libperl")
 
6
(c-include '("EXTERN.h" "perl.h") :include-dirs "/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE")
 
7
 
 
8
(define perl (perl_alloc))
 
9
(perl_construct perl)
 
10
(perl_parse perl NULL 3 '("" "-e" "0") NULL)
 
11
(perl_run perl)
 
12
 
 
13
(Perl_eval_pv perl "$var = 3; $var **=2;" TRUE)
 
14
(print (SvIVX (Perl_get_sv perl "var" FALSE)))
 
15
 
 
16
(perl_destruct perl)
 
17
(perl_free perl)
 
18
 
 
19