473,465 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HTML Page Refresh doesn't work in my PERL web page

8 New Member
I have several web pages that are perl files with .pl extensions. Inside these I have HTML code for the web page display. I am trying to have a certain page refresh every five minutes.

I was told to use <META HTTP-EQUIV="Refresh" CONTENT="300"> and place it inside the HEAD tags. Well this doesn't work because when I click on the link to go to the page, I get and error.

Does anyone have any ideas please?
Jul 11 '07 #1
9 4412
miller
1,089 Recognized Expert Top Contributor
and the error that you receive is?

- Miller
Jul 11 '07 #2
Shalako
8 New Member
Oops sorry. Here it is:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, @@ServerAdmin@@ and inform them of the time the error occurred, and anything you may have done to cause the error.
More information may be available in the server error log.
Apache/2.0.40 Server at 192.168.107.20 Port 80"

I checked the error log and it said:

[Wed Jul 11 12:44:37 2007] [error] [client 192.168.107.20] malformed header from script. Bad header= Missing gauge reports are ind: padata.pl
[Wed Jul 11 12:44:37 2007] [warn] /perl/PEMA/padata.pl did not send an HTTP header
[Wed Jul 11 12:44:37 2007] [error] [client 192.168.107.20] malformed header from script. Bad header= : padata.pl
[Wed Jul 11 12:44:37 2007] [warn] /perl/PEMA/padata.pl did not send an HTTP header
[Wed Jul 11 12:44:37 2007] [error] [client 192.168.107.20] malformed header from script. Bad header= Missing gauge reports are ind: padata.pl
[Wed Jul 11 12:44:37 2007] [warn] /perl/PEMA/padata.pl did not send an HTTP header
[Wed Jul 11 12:44:37 2007] [error] [client 192.168.107.20] malformed header from script. Bad header= Missing gauge reports are ind: padata.pl
[Wed Jul 11 12:44:37 2007] [warn] /perl/PEMA/padata.pl did not send an HTTP header
[Wed Jul 11 12:44:37 2007] [error] [client 192.168.107.20] malformed header from script. Bad header= Missing gauge reports are ind: padata.pl
[Wed Jul 11 12:44:37 2007] [warn] /perl/PEMA/padata.pl did not send an HTTP header

Any ideas? Thanks for the help.
Jul 11 '07 #3
Shalako
8 New Member
Sorry to include so much in the above post. I just want to make sure all the info is available.

Let me know what you experts think. Thanks for the help. :)
Jul 12 '07 #4
KevinADC
4,059 Recognized Expert Specialist
Looks like your perl file is missing an http header. Can we see one of the perl files that generates these errors?
Jul 12 '07 #5
Shalako
8 New Member
Here it is. I bolded the line where I have the refresh code. I have a comment mark in front of it right now but when I take it out, it gives me the error. Thanks.

# padata.pl
# ------------
# Displays All PA Tabular Data
#
# Author:
#
# Revisions: (none)
# ------------------------------------------------------------------------------

use strict;
use CGI ":standard";
use integer;


my $tome = time ;


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

print "<BODY BGCOLOR=#CFEEFF TEXT=#1346AD BACKGROUND=/DWGraphics/DWBG.jpg>\n" ;

################################################## ################

# Stores Tabular Data File Path into a Var.
my $TabularData1 = "/Apache2/htdocs/DWTemp/TabularData$tome.txt" ;


# Creates the tabular text file to be displayed later in the page.
my $StationCommand25 = sprintf("/DW/Utils/reportgen.exe g=1 f=$TabularData1") ;
my $systemCommand25 = $StationCommand25 ;
system $systemCommand25 ;



# Opens the tabular text file and stores it's content in an array.
open (GReader, "<$TabularData1") || die "couldn't open the file!" ;
my @raw_data1 = <GReader> ;
close (GReader) ;

################################################## ################

# Stores Tabular Data File Path into a Var.
my $TabularData2 = "/Apache2/htdocs/DWTemp/TabularData$tome.txt" ;


# Creates the tabular text file to be displayed later in the page.
my $StationCommand25 = sprintf("/DW/Utils/reportgen.exe g=2 f=$TabularData2") ;
my $systemCommand25 = $StationCommand25 ;
system $systemCommand25 ;



# Opens the tabular text file and stores it's content in an array.
open (GReader, "<$TabularData2") || die "couldn't open the file!" ;
my @raw_data2 = <GReader> ;
close (GReader) ;

################################################## ################

# Stores Tabular Data File Path into a Var.
my $TabularData3 = "/Apache2/htdocs/DWTemp/TabularData$tome.txt" ;


# Creates the tabular text file to be displayed later in the page.
my $StationCommand25 = sprintf("/DW/Utils/reportgen.exe g=3 f=$TabularData3") ;
my $systemCommand25 = $StationCommand25 ;
system $systemCommand25 ;



# Opens the tabular text file and stores it's content in an array.
open (GReader, "<$TabularData3") || die "couldn't open the file!" ;
my @raw_data3 = <GReader> ;
close (GReader) ;

################################################## ################

# Stores Tabular Data File Path into a Var.
my $TabularData4 = "/Apache2/htdocs/DWTemp/TabularData$tome.txt" ;


# Creates the tabular text file to be displayed later in the page.
my $StationCommand25 = sprintf("/DW/Utils/reportgen.exe g=4 f=$TabularData4") ;
my $systemCommand25 = $StationCommand25 ;
system $systemCommand25 ;



# Opens the tabular text file and stores it's content in an array.
open (GReader, "<$TabularData4") || die "couldn't open the file!" ;
my @raw_data4 = <GReader> ;
close (GReader) ;

################################################## ################

# Stores Tabular Data File Path into a Var.
my $TabularData5 = "/Apache2/htdocs/DWTemp/TabularData$tome.txt" ;


# Creates the tabular text file to be displayed later in the page.
my $StationCommand25 = sprintf("/DW/Utils/reportgen.exe g=5 f=$TabularData5") ;
my $systemCommand25 = $StationCommand25 ;
system $systemCommand25 ;



# Opens the tabular text file and stores it's content in an array.
open (GReader, "<$TabularData5") || die "couldn't open the file!" ;
my @raw_data5 = <GReader> ;
close (GReader) ;

################################################## ################
# The HTML FILE IS CREATED HERE #
################################################## ################


print "<html>" ;

print "<head>" ;
#print "<META HTTP-EQUIV="Refresh" CONTENT="60">" ;

print "<title>Pennsylvania, Automated Flood Warning System</title>" ;
print "</head>" ;

print "<body alink='#ee0000' bgcolor='#ffffff' link='#0000fd' text='#000000' vlink='#551a8b'>" ;

#Menu Links.
print "<center>" ;
print "<a href='/iflows/index.htm'>HOME</a>" ;
print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" ;
print "<a href='pa.pl'>IFLOWS MENU</a>" ;
print "</center><br>" ;

print "<center>" ;
print "<pre>" ;
print "<b>" ;
print "Data for <a href='Allegheny.pl'>Allegheny</a> County, Pennsylvania" ;
print "<BR>" ;
# Prints the tabular text data that is stored in the array to the screen.
print "@raw_data1" ;

print "</b>" ;
print "</pre>" ;
print "</center>" ;

print "<BR>" ;
print "<BR>" ;

print "<center>" ;
print "<pre>" ;
print "<b>" ;
print "Data for <a href='Armstrong.pl'>Armstrong</a> County, Pennsylvania" ;
print "<BR>" ;
# Prints the tabular text data that is stored in the array to the screen.
print "@raw_data2" ;

print "</b>" ;
print "</pre>" ;
print "</center>" ;

print "<BR>" ;
print "<BR>" ;

print "<center>" ;
print "<pre>" ;
print "<b>" ;
print "Data for <a href='Bedford.pl'>Bedford</a> County, Pennsylvania" ;
print "<BR>" ;
# Prints the tabular text data that is stored in the array to the screen.
print "@raw_data3" ;

print "</b>" ;
print "</pre>" ;
print "</center>" ;

print "<BR>" ;
print "<BR>" ;

print "<center>" ;
print "<pre>" ;
print "<b>" ;
print "Data for <a href='Bradford.pl'>Bradford</a> County, Pennsylvania" ;
print "<BR>" ;
# Prints the tabular text data that is stored in the array to the screen.
print "@raw_data4" ;

print "</b>" ;
print "</pre>" ;
print "</center>" ;

print "<BR>" ;
print "<BR>" ;

print "<center>" ;
print "<pre>" ;
print "<b>" ;
print "Data for <a href='Butler.pl'>Butler</a> County, Pennsylvania" ;
print "<BR>" ;
# Prints the tabular text data that is stored in the array to the screen.
print "@raw_data5" ;

print "</b>" ;
print "</pre>" ;
print "</center>" ;

print "<BR>" ;
print "<BR>" ;

print "</center>" ;
print "</body>" ;
print "</html>" ;

################################################## ################
Jul 12 '07 #6
KevinADC
4,059 Recognized Expert Specialist
You have double-quotes inside a double-quoted string, which will cause an error:

print "<META HTTP-EQUIV="Refresh" CONTENT="60">" ;

escape the double-quotes:

print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"60\">" ;


or more properly use a single-quoted string since there is no variable or meta character interpolation needed:

print '<META HTTP-EQUIV="Refresh" CONTENT="60">' ;

also, check the meta tag syntax to make sure it is correct for your application. I am not sure that CONTENT="60" is going to do anything.
Jul 12 '07 #7
Shalako
8 New Member
Kevin:

That worked. Thank you so much. I had to escape the quotes because the single quotes were acting funky.

I now get my html refresh inside my PERL code. Thanks so much.

Matthew K.
Jul 13 '07 #8
miller
1,089 Recognized Expert Top Contributor
I had to escape the quotes because the single quotes were acting funky.
You should avoid having to explicitly escape quoting characters in a string. Instead just use a different quoting character. If you still want interpolation, then the following is what I choose:

print qq{<META HTTP-EQUIV="Refresh" CONTENT="60">};

perldoc perlop Quote and Quote-like Operators

- Miller
Jul 13 '07 #9
Shalako
8 New Member
Thank you miller. That worked brilliantly. I am still very new to PERL and even HTML for that matter. Thank you both for your help.
Jul 13 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Rick | last post by:
Hi folks, I have a web page I wrote for a class assignment (which I embellished a little) that doesn't seem to work on all browsers, platforms, etc. The problem appears to be that the page...
8
by: Manu | last post by:
Hi there, I am using a perl script to generate this html page which just redirects users to my ftp server. The problem is I get a "page cannot be displayed" in IE 6.0 (haven't tried other...
8
by: TS | last post by:
Im in a web page and call an asynchronous method in business class. the call back method is in the web page. When page processes, it runs thru code begins invoking the method then the page...
2
by: no one | last post by:
Hi, I want to write a pearl script that will go out to a web site and download the page. Then pull certain value pairs out of it. Basically I want to see graphs of snr etc. Is grabbing the...
22
by: owlice | last post by:
Greetings! I thought I'd add a little something to a web site, a "tip of the week," and wanted it automated so that if I get hit by a truck (or, more likely, am forgetful), the tip is updated...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
1
by: worlman385 | last post by:
I need to parse the following HTML page and extract TV listing data using VC++ http://tvlistings.zap2it.com/tvlistings/ZCGrid.do any good way to extract the data? is easy for VC++ to call...
4
by: Jeff | last post by:
I've been working on porting some perl CMS code to PHP. What I would do in perl is search through a template for instruction and replace those instructions with specific bits for that particular...
5
by: sukatoa | last post by:
I don't know where to put this thread exactly, but i just want some recommendations about my problem.... I wonder why some of my GIF images doesn't show on my page..... May i know what should...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.