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.
Use eq for string comparison (or == for a numeric one).
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:
= assigns, it does not compare!> $choice=<STDIN>; > if ($choice="1") { > $choice="Turkey"; > } > else choice="2"...etx
Use eq for string comparison (or == for a numeric one).
janx
In Section
Seekers of Perl Wisdom