NAME

SlapbirdAPM::Agent::CGI

The SlapbirdAPM user-agent for CGI applications.

SYNOPSIS

  • Create an application on SlapbirdAPM

  • Install this ie cpanm SlapbirdAPM::Agent::CGI, cpan -I SlapbirdAPM::Agent::CGI

  • Add use SlapbirdAPM::Agent::CGI near the top of your CGI script

  • Add your API key to your environment, in Apache that looks like: SetEnv SLAPBIRDAPM_API_KEY ...

  • Restart your web-server

EXAMPLE

#!/usr/bin/env perl

use strict;
use warnings;

use DBI;
use SlapbirdAPM::Agent::CGI;
use CGI;

my $dbh = DBI->connect('dbi:SQLite:dbname=file.db', '', '');

my $sth = $dbh->prepare(q[select time('now');]);
$sth->execute();
my $time     = $sth->fetch->[0];
my $response = 'Hello World! It is ' . $time . " o'clock";

my $cgi = CGI->new();

print $cgi->header();
print <<"END"
<!DOCTYPE html>
<html>
  <body>
    <p>$response</p>
  </body>
</html>
END

SEE ALSO

SlapbirdAPM::Agent::Plack

SlapbirdAPM::Agent::Mojo

SlapbirdAPM::Agent::Dancer2

AUTHOR

Mollusc Software Solutions (formerly Mollusc Labs), https://github.com/mollusc-labs

LICENSE

SlapbirdAPM::Agent::CGI like all SlapbirdAPM user-agents is licensed under the MIT license.

SlapbirdAPM (the website) however, is licensed under the GNU AGPL version 3.0.