Virtuoso functionality can be enhanced through external
libraries by loading shared objects or DLLs. The new functions are
written in a language of the developer's choice and compiled to
produce a shared library appropriate to the operating system. The
path to the shared library must be declared in the Virtuoso INI
file and the server restarted before it can be used.
The Perl language is hosted within Virtuoso in this way.
hosting_perl.so is the library used.
The Virtuoso INI file uses a [Plugins] configuration section for
listing shared libraries for the server to load upon startup. An
example of this is:
The "Hosting" type defines the entry points for initialization
of the runtime hosting environment, destruction of the user
environment and execution of a file or string containing commands
in the hosted language. It also returns a list of file extensions
that it is capable of processing. Virtuoso dynamically defines
memory-resident (no disk image) HTTP server handlers for each
The Perl hosting plugin supports 'pl' extension. Hence, upon
initialization of the hosting plugin, Virtuoso defines the
according to the API for file type handlers in the Virtuoso HTTP
server. With this handler in place, each hit on a .pl file (file
system or WebDAV) with appropriate execute permissions will cause
the HTTP server to execute the code within it and return the result
instead of simply the file's contents.
The handler will call the __hosting_http_handler VSE with a
special set of parameters to represent the HTTP environment
Virtuoso will normally call the plugin to memory as required,
and expel it when finished. This behavior can be controlled by the
INI file parameter: