title: -Perl-How to jump to the next element of a loop if error found?
body: <p>I just finished a Perl script (which is doing great) with the form:</p>
  
  <pre><code>my @plages_IP = ('10.7.10.103' ,'10,121,10,7', '10.120.10.10');
  
  foreach my $IP (@plages_IP)
  {
     DO ALL THE THING I WANT;
  }
  </code></pre>
  
  <p>My problem is that for some reason, 1 or more IP in my list may be busy at the time i launch the script. In that case, i get some perl error (wich are normal) and the script die:</p>
  
  <pre><code>'Error POSTing http://10,121,10,7/wcd/login.cgi: Can't connect to 10,121,10,7:80 (Bad hostname) at C:\Users\STAGEDVIR\Desktop\gnagna\Retrieve_Counter_C364_C224_C203.pl line 51.'
  
  'Error POSTing http://10.64.10.3/wcd/login.cgi: Not Found at C:\Users\STAGEDVIR\Desktop\gnagna\Retrieve_Counter_C203.pl line 45.'
  </code></pre>
  
  <p>I don't want it to die if an error is found but to jump to the next item of the loop ;All those errors mean the same thing (IP currently busy), typically, what i want to do is:</p>
  
  <pre><code>if(ANY_ERROR &amp;&amp; LOOP_NOT_EMPTY)
  {
      DON'T DIE;
      JUMP TO THE NEXT ELEMENT OF THE LOOP;
  }
  </code></pre>
  
  <p>I tried some solution with <code>eval{ routine_might_die }; warn $@ if $@;</code> and some ways like:</p>
  
  <pre><code>unless($boolean_descripting_last_request-&gt;is_success)
  {
      print(STDERR "Currently busy $IP ! \n");
      **next**;
  }
  </code></pre>
  
  <p>But the script keeps dying to the first error he finds due to IP currently busy.</p>