summaryrefslogtreecommitdiff
path: root/Xerl/Main
diff options
context:
space:
mode:
authorPaul Buetow (pluto.buetow.org) <paul@buetow.org>2013-09-28 22:18:24 +0200
committerPaul Buetow (pluto.buetow.org) <paul@buetow.org>2013-09-28 22:18:24 +0200
commitfd7590d71aeee380e7c87ed77de592df1f30f5ef (patch)
tree16884f61fbf6b75246784f8209cfa08786157fd4 /Xerl/Main
parent340aa6d143806c2c800d0cb44e0e3ed5dd6e3a15 (diff)
Some small refactoring
Diffstat (limited to 'Xerl/Main')
-rw-r--r--Xerl/Main/Global.pm28
1 files changed, 16 insertions, 12 deletions
diff --git a/Xerl/Main/Global.pm b/Xerl/Main/Global.pm
index 5ed8567..291eca7 100644
--- a/Xerl/Main/Global.pm
+++ b/Xerl/Main/Global.pm
@@ -45,8 +45,23 @@ sub PLAIN {
sub REDIRECT ($) {
my $location = shift;
+
say "Status: 301 Moved Permanantly";
print "Location: $location\n\n";
+
+ return undef;
+}
+
+sub HTTP {
+ my $descr = _HTTP_DESCR(shift);
+
+ print $descr;
+ local $, = ' ';
+ print $descr;
+
+ Xerl::Main::Global::SHUTDOWN();
+
+ # Never reach this point
return undef;
}
@@ -55,6 +70,7 @@ sub _HTTP_DESCR ($;$) {
$infomsg //= '';
+ # Sub returns one of the strings below
if ( $status == 404 ) {
"Status: 404 Not Found $infomsg\015\012\n\n"
@@ -64,16 +80,4 @@ sub _HTTP_DESCR ($;$) {
}
}
-sub HTTP {
- my $descr = _HTTP_DESCR(shift);
- print $descr;
- local $, = ' ';
- print $descr;
-
- Xerl::Main::Global::SHUTDOWN();
-
- # Never reach this point
- return undef;
-}
-
1;