aboutsummaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
Diffstat (limited to 'perl')
-rwxr-xr-xperl/cgi.pl14
1 files changed, 10 insertions, 4 deletions
diff --git a/perl/cgi.pl b/perl/cgi.pl
index d19c915..b802979 100755
--- a/perl/cgi.pl
+++ b/perl/cgi.pl
@@ -21,8 +21,14 @@ use Data::Dumper;
use Git::Repository;
use lib qw(. ..);
-BEGIN { require 'config.default.pl'; }
-BEGIN { require 'config.pl' if -f 'config.pl'; }
+BEGIN {
+ # ignores redefinition... and everything else
+ open my $stderr, '>&', \*STDERR;
+ open STDERR, '>', '/dev/null';
+ require 'config.default.pl';
+ require 'config.pl' if -f 'config.pl';
+ open STDERR, '>&', $stderr;
+}
sub info {
warn join(' ', @_);
@@ -87,13 +93,13 @@ my $dbfile = DB_FILE;
my %data = (
found => 0,
-);
+ );
my %routes = (
'/' => sub { GN::index($root); },
'/~([\w.]+)' => sub { GN::user($root, @_) },
'/~([\w.]+)/([\w.]+)' => sub { GN::repository($root, @_) },
-);
+ );
my %route_regex_cache = map { $_ => qr{^$_$} } keys %routes;
sub master {