in reply to Calling different methods based on a CGI parameter
update: <cough> added the call to the sub :-)#!/usr/bin/perl use strict; use warnings; my %dispatch = ( table1 => \&_upload_table1, table2 => \&_upload_table1, ); my $tablename = cgi->param('tablename'); die qq{bad param\n} unless exists $dispatch{$tablename}; $dispatch{$tablename}->(); sub _upload_table1 { } sub _upload_table2 { }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling different methods based on a CGI parameter
by palette (Scribe) on May 21, 2008 at 12:23 UTC | |
by wfsp (Abbot) on May 21, 2008 at 12:52 UTC |