in reply to perl fool - inserting text into html doc

I've worked in situtaions like that and it takes a bit, and I'm just going drop a little idea here, not really advice. One of the things I found works really well is to parse up pages into seperate files. Header, Footer, Body, Menu, CSS etc... Areas of the page that change and areas that don't. Then, build the part that changes, and then build the new page from the template files. Most HTML pages can be parsed out this way to some degree, and you may find that yours can be done this way too.

This method works if its not "real time data" you are after, and if you have ftp access to the main server. The program builds the page, and then sends it to the server replacing the existing one.

Another simple idea is to put HTML comments in to the file and parse the page into array cells or hash cells using those as markers. Then feed the new information into the proper cell and put the file back out. Neither one of these ideas requires any modules at all, except the core ones. NET::FTP is about it if you want to do this remotly.

Modules are good, because they are completed tested code, but like your sysadmin, not all ISP's want to deal with the hassles that they bring. So, its good to find tricks to do as well.

Of course you could build the template pages on the one server and have the program update the production server using a cron job, or something of that nature.

Good luck to you and I hope this helps

webadept

  • Comment on Re: perl fool - inserting text into html doc