title: How do I break an outer loop from an inner one in Perl?
body: <p>Suppose I have a piece of Perl code like:</p>
  
  <pre><code>foreach my $x (@x) {
   foreach my $y (@z) {
    foreach my $z (@z) {
     if (something()) {
      # I want to break free!
     }
     # do stuff 
    }
    # do stuff
   }
   # do stuff
  }
  </code></pre>
  
  <p>If <code>something()</code> is true, I would like to break ('last') all the loops. </p>
  
  <p>how can I do that?
  I thought of two options, both of which I don't like: 
  Using something <code>GOTO</code>
  Adding a boolean variable which will mark <code>something()</code> is true, check this var in each of the loops before they resume and <code>last()</code> if it's true.</p>
  
  <p>Any suggestions or thoughts?</p>
  
  <p>Thanks.</p>