One way is with separate Lua scripts, which live at a location as indicated by the script_dir parameter (passed to the constructor) or as indicated by the LUA_SCRIPT_DIR environment variable.

The other way is by putting the source code of the Lua scripts in this module, in the %Scripts hash.

Which way is actually used depends on whether or not passing info about a path to Lua scripts. If a Lua script location is known, those script will be used, otherwise the %Scripts code is used.

During development it is more convenient to use the separate Lua files of course. But for deploying it is less error prone if the Lua code is inside the Perl module. So that is why this is done this way.