I have a general question about Perl CGI programs. For a few applications, not using MVCs, developers write CGI programs, may be using CGI.pm or some other way they like and for moving from screen to sceen, a new CGI program is written, (with - CVS TAGS, Perl headers etc etc..).
But what I feel is if there is some stuff (subroutine or business logic) which is not required in other programs, I keep on calling same script with each page called based on one extra Role parameter. Benefit I get is one time header declaration, easy to maintain,
%frmData = CGI::Lite->parse_form_data();
$Role = $frmData{Role};
if ($Role eq 'A'){ getPageFirst()}
elsif ($Role eq 'B'){ getPageB()} etc..
Is this a correct approach? Can we face some kind of problem. What will be the best approach?