Hi.
I have a problem with a subroutine I wrote. It opens and HTML page, reads it into an array, and then writes the HTML page to SYSOUT (the users PC screen). It also inserts variables and stuff that the Javascript in the system needs, but that isn't where the problem is. Anyway, it works most of the time just fine.
Problem is, sometimes when it reads the HTML file in, it isn't getting the whole file. So when it tries to send it to SYSOUT (the screen), most of the file gets written out, and then the whole process stops. So I end up with a blank screen. When I do a 'view source' on the HTML, part of it is there, and the browser just keeps 'spinning', waiting for the rest which never comes.
Here is the code I'm using for this:
#open the HTML file - this file should already exist.
open (HTMLFILE, "<$HTMLPageName"
|| die "Cannot find HTML file.
Please note this message and contact the ZZZ help
desk at (999)999-999 or 1-800-999-999 ext \#655.
Program readSendHTML in HTMLIO.PM";
#store HTML file in array
@indata = <HTMLFILE>;
close (HTMLFILE);
foreach $i (@indata)
{
#remove end of line character from record incoming
chomp($i);
#print the regular HTML line of code and end of line aracter
print "$i \n";
}
This is a nutshell version of the code just showing the I/O parts of the HTML file being read.
Anyway, I'm wondering what might be causing the whole file to not be read into the array. I've read some information regarding buffers and such, but haven't used them, flushed them, or anything else. Any ideas and thoughts on this would be much appreciated.
Thank you!
Kathy
I have a problem with a subroutine I wrote. It opens and HTML page, reads it into an array, and then writes the HTML page to SYSOUT (the users PC screen). It also inserts variables and stuff that the Javascript in the system needs, but that isn't where the problem is. Anyway, it works most of the time just fine.
Problem is, sometimes when it reads the HTML file in, it isn't getting the whole file. So when it tries to send it to SYSOUT (the screen), most of the file gets written out, and then the whole process stops. So I end up with a blank screen. When I do a 'view source' on the HTML, part of it is there, and the browser just keeps 'spinning', waiting for the rest which never comes.
Here is the code I'm using for this:
#open the HTML file - this file should already exist.
open (HTMLFILE, "<$HTMLPageName"
Please note this message and contact the ZZZ help
desk at (999)999-999 or 1-800-999-999 ext \#655.
Program readSendHTML in HTMLIO.PM";
#store HTML file in array
@indata = <HTMLFILE>;
close (HTMLFILE);
foreach $i (@indata)
{
#remove end of line character from record incoming
chomp($i);
#print the regular HTML line of code and end of line aracter
print "$i \n";
}
This is a nutshell version of the code just showing the I/O parts of the HTML file being read.
Anyway, I'm wondering what might be causing the whole file to not be read into the array. I've read some information regarding buffers and such, but haven't used them, flushed them, or anything else. Any ideas and thoughts on this would be much appreciated.
Thank you!
Kathy