vivekvp has asked for the wisdom of the Perl Monks concerning the following question:


I have a screen and I want to prompt the users for 1 of 3 choices.
Let's say I have a screen that says:

Choose 1 of the 3 options: 1=Turkey 2=Steak 3=Apple Choose one:
What would be a good method to code this?

Is there a perl CASE statement or am I doing a bunch of if-then statemetents?
i.e. $choice=<STDIN>; if ($choice="1") { $choice="Turkey"; } else choice="2"...etx

Ultimately I am going to have many choices (10-20).
Any suggestions on how to tackle this efficiently?

He who laughs last, doesn't get the joke.