diff --git a/Changes.md b/Changes.md index 0d2c3b8..e48447e 100644 --- a/Changes.md +++ b/Changes.md @@ -9,6 +9,7 @@ Not yet released: v0.03-beta - Fixed an issue with WebPerl::JSObject::toperl() where JS objects were not being converted properly. - Added AJAX demo +- Added WebPerl autoloading for script tags - ... diff --git a/web/webperl.js b/web/webperl.js index f99320e..b01877a 100644 --- a/web/webperl.js +++ b/web/webperl.js @@ -94,8 +94,24 @@ window.addEventListener("load", function () { } else if (scripts.length) { console.debug("Perl: Found",scripts.length,"embedded script(s), autorunning..."); - //TODO: should we maybe prefix "use warnings; use 5.028;"? or at least "use WebPerl qw/js/;"? - Perl._saveAndRun( scripts.join(";\n") ); + var code = scripts.join(";\n"); + + // get the first five lines of code + var n = 5 + 1; // the contents of the