WebPerl uses the power of WebAssembly and Emscripten to let you run Perl 5 in the browser!
WebPerl is a project designed to run Perl in the browser.
WebAssembly Port: WebPerl utilizes the power of WebAssembly (Wasm) and Emscripten.
Direct Binary Port: Critically, WebPerl does not translate Perl code to JavaScript. Instead, it is a port of the standard perl binary to WebAssembly, ensuring users have the full power of Perl at their disposal.
Perl 6 Support: It offers experimental Perl 6 support.
Browser Interaction: Perl code running via WebPerl can interact with JavaScript elements. For example, it can target elements by ID, add event listeners, and trigger JavaScript functions like window.alert.
Output Handling: By default, standard output (such as the result of a print statement) goes to the JavaScript console.
Development Status: WebPerl is very much in beta. The developer notes that some features may not work yet, and parts of the API may still change. Feedback is appreciated.
Open Source: The project's sources are available on GitHub (haukex/webperl).
Related Tools: Beta web applications written using WebPerl are available, including the WebPerl Code Demo Editor and the WebPerl Regex Tester.
Prerequisites: To use the Quick Start method, users need a recent version of Perl (recommended v5.26 and up) and cpanm to install dependencies.
Deployment: WebPerl can be deployed by downloading the prebuilt ZIP archive (e.g., webperlprebuiltv0.09-beta.zip), installing dependencies via cpanm, and running plackup webperl.psgi.
Hosting: Content can be accessed locally via a browser at http://localhost:5000/ after running plackup. Alternatively, the contents of the ZIP archive can be hosted on a webserver of the user's choice.
Examples: The ZIP archive contains several examples, including webperl_demo.html.