-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.pl
More file actions
41 lines (32 loc) · 694 Bytes
/
example.pl
File metadata and controls
41 lines (32 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl
#This file should work in order to say that
#Outline::Lua works.
use warnings;
use strict;
use lib 'lib';
use Outline::Lua;
use Data::Dumper;
$| = 1;
my $lua = Outline::Lua->new();
$lua->loadstdio(); # stdin, stdout, stderr
$lua->register_perl_func(
{
lua_name => 'get_vector',
perl_name => 'main::get_vector', # OR func => \&get_vector
},
{
lua_name => 'add_vectors',
func => \&add_vectors,
},
{
lua_name => 'vector_list',
func => \&vector_list,
context => 'list',
}.
);
$lua->run( <<EOLUA );
vector1 = get_vector(4, 4, 4)
vector2 = get_vector(1, 2, 3)
vector3 = add_vectors(vector1, vector2)
print(vector3)
EOLUA