diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-10-04 08:33:31 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-04 08:33:31 -0700 |
commit | da2f94c54905de8d600063fdd63a3a6b76d27616 (patch) | |
tree | 68fb78a0cd6bf27b34c8a82086ead316e2134e10 | |
parent | 94824daa35eb9acedff60f3e3d5098b75407327b (diff) | |
download | perl-da2f94c54905de8d600063fdd63a3a6b76d27616.tar.gz |
perlop.pod: Clarify -’s string/number distinction
-rw-r--r-- | pod/perlop.pod | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod index c99f672e7e..707df4a271 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -194,11 +194,12 @@ Unary "!" performs logical negation, i.e., "not". See also C<not> for a lower precedence version of this. X<!> -Unary "-" performs arithmetic negation if the operand is numeric. If -the operand is an identifier, a string consisting of a minus sign -concatenated with the identifier is returned. Otherwise, if the string -starts with a plus or minus, a string starting with the opposite sign -is returned. One effect of these rules is that -bareword is equivalent +Unary "-" performs arithmetic negation if the operand is numeric, +including any string that looks like a number. If the operand is +an identifier, a string consisting of a minus sign concatenated +with the identifier is returned. Otherwise, if the string starts +with a plus or minus, a string starting with the opposite sign is +returned. One effect of these rules is that -bareword is equivalent to the string "-bareword". If, however, the string begins with a non-alphabetic character (excluding "+" or "-"), Perl will attempt to convert the string to a numeric and the arithmetic negation is performed. If the |