[EMAIL PROTECTED] wrote:

I respectfully disagree. I think you're focusing too much on the low-level

behavior of || returning one of its operands. That behavior makes Perl's syntax
flexible and a little ambiguous. Because Perl doesn't make a distinction between
"assign with a default value" and "perform a boolean OR" Devel::Cover it has to
play it conservatively.
You shouldn't shift the burden to somewhere else (where $foo is subsequently
used) either, because you don't know how it will be used. It could be
 1) a boolean in a condition
 2) used in another "$a = $b || $c" type expression
 3) an output that only appears in a print() statement
 ...

In any of these cases, it's possible that $foo is really a boolean but by the
method you proposed $foo would only be tested for taking both true and false
values in the first one.

I appreciate your point of view. My suggestion (as I stated in my original post) is conditional on being able to determine the context in which the "||" is used. If you read the documentation for Want.pm or perldoc perlguts (search for "context propogation") there seems to be the possibility of doing this -- though I freely admit that I don't understand perlguts well enough to say.

Regards,
David Golden

Reply via email to