From cc1ce8c754179259c19940fcb77a285a6213a6f1 Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Wed, 7 May 2025 22:24:57 -0600 Subject: [PATCH] -- --- perl/Triple.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/perl/Triple.pm b/perl/Triple.pm index 8532ebe..606c737 100644 --- a/perl/Triple.pm +++ b/perl/Triple.pm @@ -22,7 +22,7 @@ use constant { our %page = ( '' => [ STATIC_PAGE, '404', '404 Not Found', '404 Not Found' ], - '/' => [ STATIC_PAGE, 'index', 'Chendex', 'Forum Index' ], + '/' => [ STATIC_PAGE, 'index', 'Chendex', 'Forum Index' ], '/+/' => [ DYNAMIC_PAGE, 'img', '+', 'General Discussion Board' ], '/sys/' => [ DYNAMIC_PAGE, 'img', 'System', 'Site Info' ], ); @@ -40,16 +40,21 @@ sub Triple::main { my $cgi = CGI->new; my $vars = { - + ip => $ENV{'REMOTE_ADDR'} || '?', + uri => $ENV{'REQUEST_URI'} // '/', }; - my $path = $ENV{'REQUEST_URI'} // '/'; - print $cgi->header( -Content_Type => 'text/html', -charset => 'UTF-8', ); - print %static{$path} // %static{''}; + + $page = %static{$vars->{uri}}; + if (not $page) { + + $page = %static{''}; + } + print $page; } } -- 2.39.5