This is a small program that I made that I will be using for my website. It is a VERY simple code that took me 5 minutes to write. You may use it for whatever you may want to use for it. You can add, redo, or take away from it (very little to take away). Your welcome to call it your own.
#!/usr/bin/perl -w
use CGI qw(:standard);
use strict; #always!
my $location = param("place");
print header;
my %subs = (
'home'=>\&home,
'news'=>\&news,
);
if (!$location){
&home
}elsif (defined(my $action = $subs{$location})){
$action->();
}
sub home{
print "this is home. I am John, hear me roar";
}
sub news{
print "this is news";
}