Perl API

2024-04-17

LabKey's Perl API allows you to query, insert and update data on a LabKey Server from Perl. The API provides functionality similar to the following LabKey JavaScript APIs:
  • LABKEY.Query.selectRows()
  • LABKEY.Query.executeSql()
  • LABKEY.Query.insertRows()
  • LABKEY.Query.updateRows()
  • LABKEY.Query.deleteRows()

Documentation

Source

Configuration Steps

  • Install Perl, if needed.
    • Most Unix platforms, including Macintosh OSX, already have a Perl interpreter installed.
    • Binaries are available here.
  • Install the Query.pm Perl module from CPAN:
    • Using cpanm:
      • cpanm LabKey::Query
    • Using CPAN:
      • perl -MCPAN -e "install LabKey::Query"
    • To upgrade from a prior version of the module:
      • perl -MCPAN -e "upgrade"
    • For more information on module installation please visit the detailed CPAN module installation guide.
  • Create a .netrc or _netrc file in the home directory of the user running the Perl script.
    • The netrc file provides credentials for the API to use to authenticate to the server, required to read or modify tables in secure folders.