---
name: "RefDB::CGI"
section: "3pm"
platform: "linux"
package: "librefdb-perlmod-perl"
version: "1.2-2"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/RefDB::CGI"
---

# RefDB::CGI(3pm)

CGI support for RefDB Perl scripts

## NAME

RefDB::CGI - CGI support for RefDB Perl scripts

## SYNOPSIS

```
  use RefDB::CGI;
  if (RefDB::CGI::check_cgi("GET") == 0) {
      $template = RefDB::CGI::load_html("/usr/local/share/myapp/template.html");
  }
```

## DESCRIPTION

Provides functions important to run RefDB scripts as CGI applications.

## FEEDBACK

Send bug reports, questions, and comments to the refdb-users mailing list at:

refdb-users@lists.sourceforge.net

For list information and archives, please visit:

http://lists.sourceforge.net/lists/listinfo/refdb-users

## AUTHOR

Markus Hoenicka, markus@mhoenicka.de

## SEE ALSO

This module is part of the RefDB package, a reference manager and bibliography tool for markup languages. Please visit http://refdb.sourceforge.net for further information.

## package functions

### check\_cgi

Title   : check\_cgi

Usage   : `$cgi` = check\_cgi($mode);

Function: Checks whether app runs as a CGI app accepting GET or POST data

Argument: mode: either "GET" or "POST"

Returns : 0 if CGI app called properly\
           1 if incorrect mode\
           2 if missing content length of POST data\
           3 if not CGI at all

### load\_html

Title   : load\_html

Usage   : `$template` = load\_html("full/path/to/template.html")

Function: Reads a HTML template into a string

Returns : string if file was found, undef if not
