keen2learn has asked for the wisdom of the Perl Monks concerning the following question:
And, here's the module called doctypeAndHeader.pm#!/usr/bin/perl -w use strict; use warnings; use CGI; use Data::Dumper; my $cgi = new CGI; BEGIN{ unshift @INC, "/var/www/vhosts/myDomain.com/secured.myDomain.com +/cgi-bin/library"; } print $cgi->header; use doctypeAndHeader; header();
package doctypeAndHeader; use strict; use warnings; use Exporter; use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); @EXPORT = ("header"); sub header{ my $doctypeAndHeader = ''; $doctypeAndHeader = getDoctypeAndHeader(); print qq($doctypeAndHeader); } sub getDoctypeAndHeader{ # configs my $pageTitle = 'Bangor Town Centre'; #my $scriptUrl = $ENV{"SCRIPT_NAME"}; #my @scriptNameArray = split( '/' , $script_url); #my $scriptName = $scriptNameArray[-1]; my $doctypeAndHeader = "<!doctype html> <html> <head> <title>$pageTitle</title> </head> <body></body> </html>"; return $doctypeAndHeader; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why server error out with module
by pryrt (Abbot) on Oct 26, 2020 at 15:38 UTC | |
|
Re: Why server error out with module
by hippo (Archbishop) on Oct 26, 2020 at 14:27 UTC | |
by keen2learn (Novice) on Oct 26, 2020 at 14:49 UTC | |
by hippo (Archbishop) on Oct 26, 2020 at 15:44 UTC | |
by keen2learn (Novice) on Oct 28, 2020 at 18:29 UTC | |
|
Re: Why server error out with module
by Anonymous Monk on Oct 27, 2020 at 00:28 UTC |