Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Formmating Mysql Health check script output.

by Cubes (Pilgrim)
on Dec 06, 2007 at 16:41 UTC ( [id://655453]=note: print w/replies, xml ) Need Help??


in reply to Formmating Mysql Health check script output.

It is not entirely clear to me what you are trying to accomplish. Do you want to run this script from your web browser -- that is, as a CGI program -- and see the output, or are you just looking for a better way to format HTML output that will be dumped into your output file to be viewed later in a web browser?

If the former, you will need a way to provide the information to your CGI script that you're currently getting from the command line. The best way to do this is with the CGI.pm module.

The CGI module can also help you with your output, but making it easy to print the headers and HTML that you need. Alternately, you could use a template system like HTML::Template or Template Toolkit.

I know you said that you don't want to re-write your code, but sometimes a little re-writing is necessary to add functionality or get things working the way you want. Using a template system would also make future changes and maintenance to your code far easier and less error-prone.

If you're really dead-set against rewriting anything, but you want to run this as a CGI program, you would need to just hard-code your command-line parameters (or use CGI.pm to get them from GET or POST parameters) and add a header output line -- minimally print "Content-type: text/html\n\n" -- somewhere before you start outputting HTML.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://655453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-09-09 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.