On 22/08/2011 10:29, Shlomi Fish wrote:
Hi Alan,

On Mon, 22 Aug 2011 14:43:48 +0530
Alan Haggai Alavi<alanhag...@alanhaggai.org>  wrote:

Hello Shlomi,

It's a good idea to always use "last LABEL;" instead of "last;" (as well as
"next LABEL;" etc. in case more loops are added in between.
⋮
http://perl-begin.org/tutorials/bad-elements/#flow-stmts-without-labels

Now I understand why it is always good to label loops that use `last`, `next`
or `redo`.

Thank you. :-)


Nice. And you're welcome.

For more insights like this, read the rest of the
http://perl-begin.org/tutorials/bad-elements/ page, and also the book Perl Best
Practices by Damian Conway, from which I borrowed a lot of advice.

This recommendation worries me as, first of all, I can't remember seeing
labels used either in this list (except to exemplify the concept) or in
working code in the field. In my mind it belongs together with the
deprecation of $_ as a measure to defend against otherwise
poorly-written code.

Just as with pronouns in natural language, implicit operands in Perl
allow the meaning of a program to be more lucid. Yes, if we are not
careful we can sometimes write confusing English where it is unclear
what 'it' or 'he' refers to, but the solution is always to restructure
the sentence rather than simply use proper nouns everywhere.

Shlomi, do you honestly give a label to every last, next etc. that you
write in live code?

What worries me more is that, in continually referring to your own web
site, you give your opinion more weight than it deserves. The existence
of the site tells me only that you are interested in the Perl language
and like to write about it. Those unfamiliar with the origin and status
status of your writings will inevitably assume more credibility than
they deserve.

Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to