Yes, and we still have no idea what you are trying to accomplish, nor really enough detail to puzzle out an answer. If you are inside a while, you don't need to goto it. You can either next LABEL to it, or just fall through the bottom of the loop. With no idea what else is in the respective loops, it's extremely hard to be useful.

# use strict, etc... OUTER: while ( 1 ) { # something1 last OUTER if ...something2...; # something3 INNER: while ( my $dir = readdir( $dh ) ) { # something4 next INNER if ...something5...; # something6 } next OUTER if ...something5...; # something7 }

Now, if some of the various somethings don't exist, you can simplify greatly. Fill in the somethings with what you want, try it, and if you are still having problems, post the code, the errors, the input and the expected output.


In reply to Re^3: next unless - and then 'until' by fishbot_v2
in thread next unless - and then 'until' by Win

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.