Pilot has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have an interesting problem which should be easy to solve, but I haven't yet. I have a Perl script that takes information from an Access database and publishes it in two HTML files, an index.htm and an index_content.htm. Index_content.htm is actually an INCLUDE in index.htm.

Once the information is published and the script is run, the two pages are created, and the include is shown correctly in FrontPage.

However, when I go to view index.htm in a regular browser, the include (index_content.htm) is NOT showing up in index.htm, although in the source, there is clearly HTML code for the include. Here is the perl code that does this:
############ WRITE INDEX FILE print "writing $web_target/index.htm\n"; open(OUTFILE, "> $outdir$web_target/index.htm"); start_narrow_page(\*OUTFILE, "$field2{title}", $field5{stylesheet2}); ########THIS IS THE INCLUDE HTML CODE##################; print OUTFILE "<p><span class=\"title\"></span><!--webbot bot=\"Includ +e\" U-Include=\"index_content.htm\" -->"; ########THIS IS THE INCLUDE HTML CODE##################; end_narrow_page(\*OUTFILE, "######\@###.lmco.com"); close(OUTFILE); print LOGFILE "$web_target/index.htm\n"; ############ WRITE INDEX_CONTENT FILE print "writing $web_target/index_content.htm\n"; open(OUTFILE, "> $outdir$web_target/index_content.htm"); # start_narrow_page(\*OUTFILE, "$field2{title}", $field5{stylesheet2 +}); #blah blah blah; #blah blah blah; # end_narrow_page(\*OUTFILE, "########@####.lmco.com"); close(OUTFILE); print LOGFILE "$web_target/index_content.htm\n";
I have tried opening and closing the file in FrontPage, that doesn't work. I have tried refreshing the page all over the place. That doesn't work either. If anyone has an idea of how to get this include to come up in a browser, please let me know. I am new to this site in general and I hope someone has an idea.
Thank you,
Pilot

Replies are listed 'Best First'.
Re: Puzzling Include Problem
by FamousLongAgo (Friar) on Oct 28, 2002 at 14:32 UTC
    Your question is more about FrontPage than it is about Perl, so I'm not sure how well we can help you. The core question is - when you view source on your index.htm file, are you seeing the code you expect to see? Meaning, is the Perl script writing:
    <!--webbot bot=\"Includ +e\" U-Include=\"index_content.htm\" -->
    into your HTML file? If it is, and assuming index_content.htm exists, your problem is with FrontPage. I am especially tempted to assume this since you mention the FrontPage program displays what you expect, while the browser doesn't. Unfortunately, FrontPage isn't standards-compliant, and I don't know much that would help you debug your HTML. All I can say is if the index.htm and index_content.htm files look right to you, then the Perl code isn't your problem.
Re: Puzzling Include Problem
by hiseldl (Priest) on Oct 28, 2002 at 14:37 UTC
    Instead of <!--webbot ...> which is a frontpage-only extension, you may want to try a server side include: <!--#include file="mailform1.txt" --> ...this assumes that SSI is enabled on your web server. You may also have to rename your 'index.html' file to 'index.shtml' for this to work properly.

    --
    hiseldl
    What time is it? It's Camel Time!