#!/usr/bin/perl use strict; use warnings; use CGI::Fast qw(:standard); use DBI; # module for the real work which has to be done use Library; # create your persistent database-handle here my $dsn = 'DBI:mysql:name_of_database'; my $dbh = DBI->connect( $dsn, 'my_user', 'my_pass', { PrintError => 0, PrintWarn => 0 } ); while ( my $fastcgi = CGI::Fast->new() ) { # the main module could also be called with the usual # CGI->new() Library::main( wwwform => $fastcgi ); }