in reply to call subroutine from cgi form

To expand on chromatic's advice, try something along these lines:
if ( $cgi_query->param('action') eq 'sub_1' ) { sub_1(); } elsif ( $cgi_query->param('action') eq 'sub_2' ) { sub_2(); } else { default_sub(); }

Replies are listed 'Best First'.
Re^2: call subroutine from cgi form
by blazar (Canon) on Aug 13, 2008 at 20:49 UTC

    Or, to expand further, and depending on the actual number of subroutines, use a dispatch table:

    ($dispatch{ $cgi_query->param('action') } || \&default_sub)->();
    --
    If you can't understand the incipit, then please check the IPB Campaign.