Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Do you know where your variables are?
 
PerlMonks  

Re: html output to a file

by ikkon (Monk)
on Apr 27, 2007 at 16:12 UTC ( #612410=note: print w/ replies, xml ) Need Help??


in reply to html output to a file

first as was told to me and I will pass it on, its always a good thing to get in the habit of useing strict.

#!/usr/bin/perl -w use strict; use CGI qw/:standard *table *Tr *td/; require "/home/httpd/cgi-bin/per +l_scripts/syb_handlers.pl"; use Sybase::DBlib; use CGI::Carp qw(fatalsToBrowser); &dbmsghandle ("message_handler"); &dberrhandle ("error_handler"); open(OUTPUTFILE, ">/home/output.htm") or die $!; # print OUTPUTFILE header; print OUTPUTFILE "<html><head>\n"; print OUTPUTFILE "<title>My Title</title></head><body>\n"; print OUTPUTFILE (loads of lines of html resulting from the database +queries) print OUTPUTFILE "</body></html>\n"; close(OUTPUTFILE);

hopeing that I understood the question right, I myself would do it simular to this, or create variables with header and footer code in it, thus the same effect.

in the code you posted you did not close the document in which you opened this can lead to bad things (dark side of the force).

hope this helps, any more questions I will do what I can to help.

Ben


Comment on Re: html output to a file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-04-20 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls