From: Rafael Garcia-Suarez Date: Thu, 25 Jun 2009 21:23:30 +0000 (+0200) Subject: Better description for the changes about the range operator in when() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=98814a2b076d20fb2fcd10275dfb36e0db2c2975;p=p5sagit%2Fp5-mst-13.2.git Better description for the changes about the range operator in when() (pointed out by Paul Fenwick) --- diff --git a/pod/perl5110delta.pod b/pod/perl5110delta.pod index 7b42a42..b6f8619 100644 --- a/pod/perl5110delta.pod +++ b/pod/perl5110delta.pod @@ -20,8 +20,18 @@ in a smart match: =item flip-flop operators -The C<..> and C<...> flip-flop operators are evaluated in boolean context, -following their usual semantics; see L. +The C<..> and C<...> flip-flop operators are now evaluated in boolean +context, following their usual semantics; see L. + +Note that, as in perl 5.10.0, C will not work to test +whether a given value is an integer between 1 and 10; you should use +C instead (note the array reference). + +However, contrary to 5.10.0, evaluating the flip-flop operators in boolean +context ensures it can now be useful in a C, notably for +implementing bistable conditions, like in: + + when (/^=begin/ .. /^=end/) { ... } =item defined-or operator @@ -32,7 +42,7 @@ to the regular or operator, as in C.) =back -The next paragraph details more changes brought to the semantics to +The next section details more changes brought to the semantics to the smart match operator, that naturally also modify the behaviour of the switch statements where smart matching is implicitly used.