diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-03-04 19:33:31 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-03-04 19:33:31 +0100 |
commit | f92e1a16ee2379315520131bbe3465eb837abfa3 (patch) | |
tree | aeda5a6b2ab7b0a85d973673f08b8f337b07f223 /pod/perlsyn.pod | |
parent | e74f3fd4b4b664f9ec8b6d9693d6a13bb6e50c49 (diff) | |
download | perl-f92e1a16ee2379315520131bbe3465eb837abfa3.tar.gz |
Make // behave like || in when clauses
(plus minor documentation updates about "when")
Diffstat (limited to 'pod/perlsyn.pod')
-rw-r--r-- | pod/perlsyn.pod | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index ec865103c5..83ad2c2f8b 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -531,7 +531,7 @@ This construct is very flexible and powerful. For example: } when (\&complicated_check) { - say 'complicated_check($foo) is true'; + say 'a complicated check for $foo is true'; } default { @@ -567,7 +567,7 @@ a subroutine or method call =item * a regular expression match, i.e. C</REGEX/> or C<$foo =~ /REGEX/>, -or a negated regular expression match C<$foo !~ /REGEX/>. +or a negated regular expression match (C<!/REGEX/> or C<$foo !~ /REGEX/>). =item * @@ -580,26 +580,27 @@ C<defined(...)>, C<exists(...)>, or C<eof(...)> =item * -A negated expression C<!(...)> or C<not (...)>, or a logical +a negated expression C<!(...)> or C<not (...)>, or a logical exclusive-or C<(...) xor (...)>. =back -then the value of EXPR is used directly as a boolean. +In those cases the value of EXPR is used directly as a boolean. + Furthermore: =over 4 -=item o +=item * If EXPR is C<... && ...> or C<... and ...>, the test is applied recursively to both arguments. If I<both> arguments pass the test, then the argument is treated as boolean. -=item o +=item * -If EXPR is C<... || ...> or C<... or ...>, the test +If EXPR is C<... || ...>, C<... // ...> or C<... or ...>, the test is applied recursively to the first argument. =back |