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


in reply to STDIN method?

No, sorry. There is no built-in case/switch statement (yet - in Perl 6 there will be, it's called given).
If you don't mind source filters though, there is the excellent module Switch.pm by Damian Conway.

Otherwise you will have to use if/elsif statements.

Be aware:

> $choice=<STDIN>; > if ($choice="1") { > $choice="Turkey"; > } > else choice="2"...etx
= assigns, it does not compare!
Use eq for string comparison (or == for a numeric one).

janx