> The statement I read was "true in any possible way", which implies that
> if $retval had a "true" property, the result of func would be
> irrelevant, since if func gave 0, "any possible way" would see the
> "$retval is true" property and take the "it worked" route.
>
> Thus, this code:
>
> my $retval is true;
>
> if ($retval = func(@args))
> {
> # it worked...
> }
> else
> {
> # nope...
> print $retval.what_went_wrong, "\n";
> }
Yes... if you are using only the "true" property. But assume func()
can attach either "true" or "false" to its return value (and in the
latter case, also the "what_went_wrong" property to indicate the cause,
$retval.what_went_wrong("Gorkulator borked.").)
> I don't mind the presence of these potentially horribly confusing
> thingys. After all, thanks to this list I'll be on the right side of
> the learning curve. However, I don't think that "Poo, poo." is the
> correct answer to "How about maintainability?" on anybody's multiple
> choice exam.
I understand your worry but if you are concerned about "more features
equals less maintainability" you have obviously chosen the wrong
language, be it Perl 5 or Perl 6. No, I'm rather serious. Perl has
been, is, will be, a pragmatic language that borrows with gusto, and
as a result it has a horde of features.
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
Thread Previous
|
Thread Next