in reply to CGI newbie

there are a couple of mistakes in your code i see:

$q->h3(tomorrow we will have sun')

should become

$q->h3('tomorrow we will have sun')

and

$q->h3('Good Morning!)

should become

$q->h3('Good Morning!')

You could prolly use also use something like $q->start_html.

Question 1: not really sure..

Question 2: Buffering, you may need it, you may not. Buffering is turned on by default in perl, what you are doing is turning it off, this means, as your script prints to standard out, it will be displayed in the browser. The alternative (autoflush off, $|=0) will buffer all the output, then send it to your broswer all at once at the end of your script. Why use buffering? have a look here

Question 3: Not quite sure exactly what you mean, however you can form valid HTML in any method you choose, as long as it ultimately goes so STDOUT...

Question 4: as mentioned above, its completely application dependant...