http://www.perlmonks.org?node_id=138815

einerwitzen has asked for the wisdom of the Perl Monks concerning the following question: (cgi programming)

I have a cgi file that recieves $function and $file. and has if/then statements saying things like
if ($function eq "open") { open (BLAH, "$file"); #actions close (BLAH); } elsif ($function eq "create") { open (NETH, ">$file"); #actions close (NETH); } else { #actions }
it's messy and hard to work with this way (a lot more funstions than i showed :), is there a way to do the same sort of thing without if then statements?

Originally posted as a Categorized Question.