\[ Using - [Building](building.html) - [Notes](notes.html) - [Legal](legal.html) - [GitHub Wiki](https://github.com/haukex/webperl/wiki/Using-WebPerl) \] 🕸️🐪 Using WebPerl ================ Basic Usage ----------- ### Serving WebPerl You should serve WebPerl via a webserver of your choice, or you can use the included simple `webperl.psgi` for testing. You can run it using [`plackup` from Plack](https://metacpan.org/pod/distribution/Plack/script/plackup) by simply saying `plackup webperl.psgi`. The following four files make up WebPerl: - `webperl.js` - Contains the WebPerl JavaScript API and supporting code. - `emperl.js` - Emscripten-generated supporting JavaScript. - `emperl.wasm` - The `perl` binary and libraries compiled to WebAssembly. - `emperl.data` - The Emscripten virtual file system data (`.pm` files etc.). I strongly recommend you add a MIME type of `application/wasm` for `.wasm` files, otherwise you may see warnings like "wasm streaming compile failed: TypeError: Response has unsupported MIME type" and "falling back to ArrayBuffer instantiation". For example, in an Apache `.htaccess` file, you can say: `AddType application/wasm .wasm` Note that opening the files locally (via `file://`) will likely not work due to browsers' Same-Origin Policy. See also the Emscripten deployment notes at , in particular I'd recommended using gzip encoding to serve the WebPerl files. ### Including Perl code in your HTML In your HTML file, add the following (usually inside the `` tags): Then, you can add one or more `` tag which loads a Perl script from the server - but not both! The code from multiple `