I'm getting increasing amounts of work which involve allowing a database to be manipulated, searched, edited, etc via a web-page. The back-end DB is MySQL, and I have no problem with the DBI module which provides a very complete set of DB access routines. I also make extensive use of HTML::Template, which makes data presentation
a bit much easier.
However, it is a pita to write routines which create an SQL query based on user input (eg when searching); to check for errors in data entry and notify the user of those errors; to format the records for viewing by the user. If I could do it just once in a generic fashion, that would save me hours per project, but it seems like each application needs numerous tweaks and adjustments which take a long time to code and maintain.
I realise that for some of this, "them's the breaks" and it's what a programmer is for. But if you have any techniques, modules or tricks that you use to make such programming easier, please share your insight so I can become better at this sort of thing. I'm particularly interested in genericising the code I write so I can reuse it, in CPAN-type modules, and web resources or books which might help.
TIA.