in reply to Re: Too many arguments for main::
in thread Too many arguments for main::

Or what about this?
while (1) { # print ... if (...) { # ... last; } elsif (...) { # ... last; } }
This is an infinite loop that can be "broken" with the last command. I find using labels to be rather pointless in most circumstances. After all, you can redo a block with no label at all.

Replies are listed 'Best First'.
Re: Re^2: Too many arguments for main::
by runrig (Abbot) on Oct 30, 2002 at 17:21 UTC
    This is an infinite loop that can be "broken" with the last command. I find using labels to be rather pointless in most circumstances. After all, you can redo a block with no label at all.

    Hmm, several last statements vs. one redo. It may be a matter of taste, but the lazy programmer in me likes the one redo better. And its true you don't need loop labels in this instance, and on a shorter loop I'd leave the label off. I try to avoid long loop structures, but if there is one, I prefer having a label as an easy way to see where it starts.

      To be sarcastic, I'd suggest labelling your if statements so you didn't lose track of them either.

      The multiple-break versus single-redo is, as you've suggested, a matter of personal preference. It is, in a sense, the difference between implicit behavior, or that which is implied by program structure, and explicit behavior, or that which is expressed with statements.

      But, as they say, to each their own.