in reply to CGI question: elegant way to have three form image buttons doing different things?

Looks OK to me as it is - it's pretty clear what's going on - but you could simplify it slightly like this:
my %act = ( 'view.x' => \&view , 'invite.x' => \&invite ); foreach ($query->param()) { $act{$_}->() if defined $act{$_}; } #danger, will robinson: I don't think $query->param() exists in old ve +rsions of cgi.pm
I'm not sure this is really any better than what you've got, though. Still, hth.

Andy.

  • Comment on Re: CGI question: elegant way to have three form image buttons doing different things?
  • Download Code