in reply to How can I run only part of a script determined by a posted variable?

Use a hash table containing coderefs (without creating the temporary hash):
({ 'open' => \&func1, 'create' => \&func2, 'delete' => \&func3, }->{$action} || \&default)->();

gav^

  • Comment on Re: How can I run only part of a script determined by a posted variable?
  • Download Code