Hi All!
My warmest regards to all Monks who take part in a discussion of input switch topic! Yes - CGI::Application is a kind of great module. But how about multi-runmodes: for example
Class: USERS Methods: add del list ... and so on Class: INVOICES Methods: add del print ... and so on Class: Any other class we can need Methods: Any other methods we can need
In terms of C::A mode_param is a classes and run_modes is a methods of such class
It will be better to pass to C::A mode_param method array instead of scalar.
At this time I use following code for my needs:
my @isect = (); my @union = (); my %union = (); my %isect = (); my @possible_states = ('users','sources','publisher','authors','joinus +','content','logs','genre','sq'); #Objects array my $e = ''; my @current_state = $main::CGI->param(); foreach $e (@current_state,@possible_states) { $union{$e}++ && $isect{ +$e}++ } @isect = keys %isect; my $sub_subst = uc($isect[0]) || displayQueryScreen(); my $what_to_do = $sub_subst->new(); my $action = $main::CGI->param ($isect[0]); $action =~ s/^_+//; #filtering private methods $what_to_do->$action() || displayQueryScreen ();
So, I have predefined array of accessible classes next get array of CGI hash keys and intersect them both (intersection from Perl Cookbook). First object in intersection is needed object and so on.
Question is
1. Can I use 'multi-runmodes' with C::A?
2. Why not to use my code?
In reply to multi of so called "runmodes" by well
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |