homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

mod perl: Page outputs source code
Need help getting mod_perl working correctly

 1:35 am on Oct 6, 2008 (gmt 0)

Hi All,

I have searched around the forums but cannot find an answer to my mod_perl troubles.

Basically i finally got mod_perl working where it will interpret the script BUT when i view the script on this server via a browser i get a complete dump of the page's HTML source code.

All perl code is interpreted correctly, but it's like the page's header is not being sent over correctly?

On a different server that has mod_perl working correctly, i can access the exact same script/source code and the page renders correctly.

Any pointers on where i can look?

This is an ubuntu/apache2 setup.

Thank you!

PS: Here is the start of the script im running if it helps?


print "Content-type: text/html\n\n";

###Find where we are
$pwd = join('',<PWD>);
$pwd =~ s/\n//gi;
close PWD;

### Find the system date
open(DT, 'date "+DATE: %Y-%m-%d%n<br>TIME: %H:%M:%S"');
$dt = join('', <DT>);
$dt =~ s/\n//gi;
close DT;

print "<HEAD><TITLE>Advanced Whereami.cgi</TITLE></HEAD>\n";
print "<body bgcolor='#CC3399' text='#000000'>\n";


[edited by: phranque at 8:17 am (utc) on Oct. 6, 2008]
[edit reason] disabled smileys ;) [/edit]



 8:27 am on Oct 6, 2008 (gmt 0)

maybe it's not sending a correct HTTP Response header and/or you're getting a text/plain content type in front of your document.
have a look at this documentation and see if anything there works for your situation:


 4:30 pm on Oct 6, 2008 (gmt 0)

You are missing the opening <HTML> tag... and you may want to send a DTD ahead of it.


 6:46 pm on Oct 6, 2008 (gmt 0)

phranque... Thank you sir!

PerlSendHeader On

was needed in my location def within /etc/apache2/apache2.conf

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved