[26565] in Perl-Users-Digest
Perl-Users Digest, Issue: 8703 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 24 14:05:31 2005
Date: Thu, 24 Nov 2005 11:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 24 Nov 2005 Volume: 10 Number: 8703
Today's topics:
Re: Trouble in wantarray context axel@white-eagle.invalid.uk
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 24 Nov 2005 15:39:50 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: Trouble in wantarray context
Message-Id: <a9lhf.66586$375.54702@fe3.news.blueyonder.co.uk>
Ronald Fischer <u235321044@spawnkill.ip-mobilphone.net> wrote:
> sub F()
> {
> X();
> if(wantarray)
> { my @result=Y(); Z(); @result }
> else
> { my $result=Y(); Z(); $result }
> }
> This works, and might be acceptable in this simple case, but
> it is a bit awkward, because Z() has be repeated in both
> branches, and there are two exit points instead of one.
But why change anything? In my opinion there seems a certain symmetry
which is obvious to anyone reading the code. Just because a call
to Z() is repeated is not a problem because it is only called once,
either way.
Clarity is better than obscurity, especially when it is clarity in
code whereas obscurity in code just to avoid repeating something
is pointless. (I better clarify that... using loops and so on is
not what I am talking about).
Axel
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8703
***************************************