in reply to Re: Help with HTML:Template
in thread Help with HTML:Template

Hi, Thanks roboticus ... As you can see from my code..i plan to use HTML::Template mondule..can you let me know where am i going wrong.

Replies are listed 'Best First'.
Re^3: Help with HTML:Template
by roboticus (Chancellor) on Dec 08, 2007 at 16:38 UTC
      My problem 1) Do i have to call the .pl from the browser 2) Do i have to call the template file from the browser 3) I am unable to understand how to run the files to get the output thanks..
        aalneyperl:

        I assume that you're just wanting to be able to check to see if your servers are working properly. To do this, something is going to have to run your perl program.

        Since you don't sound like you want to set up an web server for this purpose, we'll have to come up with an alternate method. (And who can blame you--*I* certainly have no desire or plan to set up a web server!)

        1) If you want the browser to do it, then it's a bit goofy, and I only know how to do it with Internet explorer. It would probably work with firefox If you want to do it that way, I can help a little by sending you a bit of script I wrote for my job. Basically, you stick in some VBScript or Javascript in the web page that can execute your perl program. Then tie the code to a button on your page.

        2) Run it as a scheduled job (use Microsoft Scheduler (if you're using Windows) or cron (if you're using a *NIX box)) ever 15 minutes or so, and you'll be able to just load the page in your browser. It'll run more often than you would do it by hand, but I'm assuming that's not a problem. Then you can just refresh the page in your browser any time you're interested in the database status. The primary disadvantage with this method is that the data may be several minutes out-of-date.

        3) Another way to do it is to alter your script to generate the HTML page and write it to a file, then tell the browser to start up and load the page. I believe you can start IE up on Windows like so (untested):

        exec 'C:\\Program Files\\Internet Explorer\\iexplore.exe', 'C:\\Temp\\StatusReport.html';
        I'd advise choosing (2) or (3).

        ...roboticus

      How do i deliver the document?
      Hi, Apologies for my ignorance...i called the template file from the browser and it just printed what what written in the template file and not the actual value from the perl file..this is my actual problem..