While understanding the basics like what a web server is is important to web programming, one doesn't need to rent hosting on a web server to dip their toes into it. You can run a web server on your local system, and test apps from it. A framework like
Dancer makes this easy (or Ruby/Rails or Catalyst or ... for that matter), you can launch any app you develop on the "built in" server, and when you decide you want to deploy your app to the world,
then you can rent hosting and run your app on a more capable server.