in reply to Spitting out a webpage
Even if you're just doing this as a learning exercise, you can read the source of HTTP::Response to get a better idea.
-David