473,241 Members | 1,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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

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 4389
miller
1,089 Expert 1GB
and the error that you receive is?

- Miller
Jul 11 '07 #2
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
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 Expert 2GB
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
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 Expert 2GB
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
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 Expert 1GB
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
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...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.