Re: Please help critcize and shorten my sub code



On Sun, 11 May 2008 02:05:06 +0200, Jenda Krynicky wrote:
You do not need the label unless you need to jump out of some other
loop than the innermost. In this case there are no nested loops so it
would probably be better to skip the label.

While I personally program the way you suggest, take note that "Perl Best
Practices" says that loops that are explicitly exited should be labelled
in all cases (http://www.oreilly.com/catalog/9780596001735/toc.html), so
we should not criticize people for following the practice.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

.



Relevant Pages

  • Re: help needed to get over endless loop
    ... Your while loops aren't actually performing any operation on the variable ... handle the strings ... if ($Lang eq en) ...
    (perl.beginners)
  • Re: add labels to line chart
    ... This means the code is only applying a label to the 6th ... Introduce a variable that loops through all series numbers, ... Select the chart and run this code: ... Dim iPts As Long ...
    (microsoft.public.excel.programming)
  • Re: New style DO syntax?
    ... Do you mean loops, constructs, or both? ... DO construct name and a DO label. ... Under the duck test of walking, ... It would be nice to have eof=EOF_error in an I/O statement rather ...
    (comp.lang.fortran)
  • Re: Labeled loop question
    ... > creak out of both loops and restart back at the label." ... "A break statement with label Identifier attempts to transfer control to the ... enclosing labeled statement that has the same Identifier as its label; ... this statement, which is called the break target, then immediately completes ...
    (comp.lang.java.programmer)
  • Re: add labels to line chart
    ... This means the code is only applying a label to the 6th ... Introduce a variable that loops through all series numbers, ... Select the chart and run this code: ... Dim iPts As Long ...
    (microsoft.public.excel.programming)