Skip to content

Commit

Permalink
document calling Perl from JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock authored Aug 18, 2017
1 parent 919164b commit 809110e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README-perlito5-JavaScript.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ Perlito5-in-JavaScript differences from "perl"
- runtime error messages often do not include the right line number in the Perl code


Calling Perl subroutines from JavaScript
=========

- var myfun = p5cget( "My::Module", "mysub" );

Export a Perl subroutine to a JavaScript variable

- var myobj = p5cget( "My::Module", "mysub" )( [ arg1, arg2 ], null );

Call a Perl subroutine.
The "null" in the end means calling in scalar context.

- var myobj = p5call( "Statistics::Distributions", "new", [ arg1, arg2 ], null );

Method call.


Internals
=========

Expand Down

0 comments on commit 809110e

Please sign in to comment.