in reply to CGI, DBI, HTTP, SQL - How does it all fit together?

It is useful to consider that PHP is specifically designed to be used “for web sites,” whereas Perl is a more general-purpose tool that relies upon packages such as CGI.   PHP takes somewhat of a “kitchen sink” approach ... a monolithic approach ... that is different (neither “better” nor “worse,” merely “different”) than the one taken by Perl.

Nevertheless:   the business purpose that you are now setting out to accomplish is a very routine one, and a very good strategy would be to try to figure out how much code you won’t have to write at all.   Work within the TWiki framework and explore thoroughly what is possible with it through the assembly of of already-existing modules versus the creation of new ones.   A little bit of “glue coding” is to be expected, but if it starts to sound like a bigger undertaking, press the Pause button and reconsider.