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


in reply to Re: Please fix my writing style
in thread Please fix my writing style

Although now with 5.10 you could do
while ( <DATA> ) { given( $_ ) { when ( $_ =~ /^NEW YORK:..../ ) { expression; } ... default { ... } } }
Which is pretty nifty, imo

I personally believe that the most powerful characteristic of C<when>'s is the syntactic sugar it provides with implicit matches: which most of the times, actually happen to be smart matches - albeit not in this particular case, in which a similar beast that is a regular bind would be used anyway; thus you wouldn't do $_ =~ /REGEX/ but just as you wouldn't do in Perl quite about anywhere: because as usual you either want to use a full fledged generic variable and the binding operator, or the "topicalizer," i.e. $_, i.e. the pronoun "it" - but implicitly!

--
If you can't understand the incipit, then please check the IPB Campaign.