T
Tim McDaniel
Just venting.
(1) I hate that
Unary "+" has no effect whatsoever, even on strings.
(per "man perlop"). Unary plus LOOKS like a unary arithmetic
operator, like "-". I was using it like "+@a", as a shorter form of
"scalar @a", until I finally found the above statement in the 5.010000
man page and realized that "+@a" was working only because I happened
to be using it in a scalar context already.
(I could do "- -@a", but that's just not as elegant as "+@a" would be.)
(2) That had effect but wasn't documented in "man perlop" in 5.005,
the version on my ISP's shell accounts.
(3) "man perlop" has
Binary "<" returns true if the left argument is numerically less
than the right argument.
et cetera, but it doesn't even mention "false" in that context and
doesn't define "true". I finally tracked down the definition not in
"man perlop", but in "man perlsyn":
Truth and Falsehood
The number 0, the strings '0' and '', the empty list "()", and
"undef" are all false in a boolean context. All other values are
true. Negation of a true value by "!" or "not" returns a special
false value. When evaluated as a string it is treated as '', but
as a number, it is treated as 0.
(4) It doesn't say which true value is returned. It could return
'0 ', it appears, and too bad if you happen to do arithmetic on it or
print it without output delimiters. And it doesn't say that the
relational operators ever return false, much less that it's the
special false.
(5) That "special false". I was going nuts trying to figure out what
was different between
$ perl -w -e 'my $j = (17 < 5); print "<$j>\n"'
<>
$ perl -w -e 'my $j = 0+(17 < 5); print "<$j>\n"'
<0>
$ perl -w -e 'my $j = 0+("" ); print "<$j>\n"'
Argument "" isn't numeric in addition (+) at -e line 1.
<0>
(6) The stupidity that I've mentioned before, of the -r / -w / -x
being defined as being ignorant of ACLs, when they should truly follow
their definitions in "man perlfunc":
-r File is readable by effective uid/gid.
-w File is writable by effective uid/gid.
-x File is executable by effective uid/gid.
(1) I hate that
Unary "+" has no effect whatsoever, even on strings.
(per "man perlop"). Unary plus LOOKS like a unary arithmetic
operator, like "-". I was using it like "+@a", as a shorter form of
"scalar @a", until I finally found the above statement in the 5.010000
man page and realized that "+@a" was working only because I happened
to be using it in a scalar context already.
(I could do "- -@a", but that's just not as elegant as "+@a" would be.)
(2) That had effect but wasn't documented in "man perlop" in 5.005,
the version on my ISP's shell accounts.
(3) "man perlop" has
Binary "<" returns true if the left argument is numerically less
than the right argument.
et cetera, but it doesn't even mention "false" in that context and
doesn't define "true". I finally tracked down the definition not in
"man perlop", but in "man perlsyn":
Truth and Falsehood
The number 0, the strings '0' and '', the empty list "()", and
"undef" are all false in a boolean context. All other values are
true. Negation of a true value by "!" or "not" returns a special
false value. When evaluated as a string it is treated as '', but
as a number, it is treated as 0.
(4) It doesn't say which true value is returned. It could return
'0 ', it appears, and too bad if you happen to do arithmetic on it or
print it without output delimiters. And it doesn't say that the
relational operators ever return false, much less that it's the
special false.
(5) That "special false". I was going nuts trying to figure out what
was different between
$ perl -w -e 'my $j = (17 < 5); print "<$j>\n"'
<>
$ perl -w -e 'my $j = 0+(17 < 5); print "<$j>\n"'
<0>
$ perl -w -e 'my $j = 0+("" ); print "<$j>\n"'
Argument "" isn't numeric in addition (+) at -e line 1.
<0>
(6) The stupidity that I've mentioned before, of the -r / -w / -x
being defined as being ignorant of ACLs, when they should truly follow
their definitions in "man perlfunc":
-r File is readable by effective uid/gid.
-w File is writable by effective uid/gid.
-x File is executable by effective uid/gid.