I am working on to create a web site to display some information about my system. This includes some graphs and some text information. For now I am creating different CGI scripts and calling them by creating links. A few days back one of my friends told me that instead of writting different CGI scripts, it’s better to write single CGI script and create functions to call the part of code. I am confused.
What do you prefer while creating a web site?
Writing a single CGI program is indeed better (slightly easier to reuse shared code) if you’re not writing the dispatch code yourself. If you commit to go this way, use a framework. CGI-Application‘s concept of runmodes is basically the formalised concept of what your friend suggested, so this is a good choice for an advancing path.
Once you outgrow this system’s limitations, have a look at Catalyst.