Overview

Contributed by Ben Bimber, University of Wisconsin

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

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:
    • perl -MCPAN -e "install LabKey::Query"
  • To upgrade from a prior version of the module:
    • perl -MCPAN -e "upgrade"
    • NOTE: The module name has changed from Labkey::Query in 1.03 to LabKey::Query in 1.04. You may have to upgrade the module using the command: perl -MCPAN -e "install LABKEY/LabKey-Query-1.04.tar.gz"
  • 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.

Discussion

previousnext
 
expand all collapse all