Home > Fluid Dynamics Search Engine > Help > 1063

How to use FDSE as a Perl API

To use FDSE as a Perl API, set $ENV{'FDSE_NO_EXEC'} = 1 and then require search.pl. When FDSE is required in this way, it will load all libraries and enter admin mode, but it won't execute any of its internal commands. Instead, it will eval the code stored in the global variable $FDSE_CALLBACK_SUB. This offers a convenient way to interface with FDSE using Perl code, with all of FDSE's global objects like $::realms and %::Rules initialized and available.

The "searchmods/powerusr/cmd_admin.pl" script provides a demo of this. The demo allows the user to list all realms, rebuild a given realm, rebuild all realms, or configure settings. The code in "cmd_admin.pl" can be used as a template for writing command line tools that do more interesting things.

Applies to version and newer.

    "How to use FDSE as a Perl API"