# always assume anything to do with files or directories is ran at project root
-no warnings 'redefine';
+no warnings;
use constant {
IMMORTAL => 1, # will continue handling request after death/error
-LOG_FILE => '/tmp/gorillanest.log',
DB_FILE => 'gorillanest.sqlite3', # sqlite3
SOCKET_FILE => '/tmp/gorillanest.socket',
use lib qw(. ..);
BEGIN { require 'config.default.pl'; }
-BEGIN { require 'config.pl'; }
+BEGIN { require 'config.pl' if -f 'config.pl'; }
sub info {
warn join(' ', @_);
while (1) {
try {
- open STDERR, '>', LOG_FILE or die LOG_FILE . ": $!";
my $request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%ENV, BARE_REQUEST ? 0 : FCGI::OpenSocket(SOCKET_FILE, SOCKET_MAX_CONNECTIONS));
while($request->Accept() >= 0) {
master();