Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: "Correct" program style questions

by kshay (Beadle)
on Oct 24, 2002 at 15:15 UTC ( #207742=note: print w/replies, xml ) Need Help??


in reply to "Correct" program style questions

This isn't one of the specific points you asked about, but I've developed a habit of not printing HTML code directly. I almost always build up a variable containing the result page, and then print it at the end.

Obviously it doesn't make any difference in this case, but in most scripts that do anything non-trivial, there are opportunities along the way for something to go wrong, in which case you want to bail out and print an error page instead of what you'd planned to return. If you've been printing pieces of your page as you go along, you can't do that.

--Kevin

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://207742]
help
Chatterbox?
[Eily]: you could have tried randomly swapping your fingers
[Eily]: enigma style
[choroba]: so it was you who typed the whole phrases?
[Yaerox]: I feel like i'm not seeing the forest for the trees. Can someone give me a hint how to research converting all kinds of files into ansi? If origin file is utf8 convert to ansi, is origin file is ansi then skip file.
[1nickt]: Yaerox probably best to whip up an SSCCE demonstrating the failure in what you have now and post to SoPW as a question.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2017-03-28 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (331 votes). Check out past polls.