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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.