From fd7590d71aeee380e7c87ed77de592df1f30f5ef Mon Sep 17 00:00:00 2001 From: "Paul Buetow (pluto.buetow.org)" Date: Sat, 28 Sep 2013 22:18:24 +0200 Subject: Some small refactoring --- Xerl/Main/Global.pm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'Xerl/Main') 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; -- cgit v1.2.3