#!/usr/bin/env perl # use strict; use warnings; use feature 'say'; use Peertube::DL::Javascript; my $a = Peertube::DL::Javascript::_duk_create_heap_default(); if ( defined $a ) { eval { my $return = Peertube::DL::Javascript::_duk_eval_wrapper( $a, "function a(nombre) { return 'Hello ' + nombre; }; a('sergio');" ); say $return; }; if ($@) { warn $@; } say Peertube::DL::Javascript::_duk_call_function( $a, "a", "sergio" ); Peertube::DL::Javascript::_duk_destroy_heap($a); }