http://qs1969.pair.com?node_id=658201


in reply to Re: Perl 5.10: switch statement demo
in thread Perl 5.10: switch statement demo

You can use when in a for loop:
for (@items) { when (/^[A-Z]/) { say "Found a proper noun? $_"; } when (/[,.]/) { say "This word has punctuation: $_"; } say "This word seems uninteresting: $_"; }