[boulder.pm] next in a for loop?

Robert L. Harris Robert.L.Harris at rdlg.net
Mon Jun 18 10:49:48 CDT 2001



  @content is the result of a get($url) which is populated correctly.

I have this:


  foreach $i (@content) {
    next if ($i =~ /^$/);

    print "\$i :$i:\n";

  }


In theory, if $i is empty ( i.e. "") it should skip to the next iteration.
I've also done a 'next $i if ($i eq "");' and a number of combinations 
of those 2.  It doesn't correctly skip the print statement.  The print
statement is just an exampla, I actually have a good bit of processing so
I cant just say "print if ($i ne ""); or such...

How do I get it to go to the next iteration of the loop if $i is empty?


:wq!
---------------------------------------------------------------------------
Robert L. Harris                |  Micros~1 :  
Senior System Engineer          |    For when quality, reliability 
  at RnD Consulting             |      and security just aren't
                                \_       that important!
DISCLAIMER:
      These are MY OPINIONS ALONE.  I speak for no-one else.
FYI:
 perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'




More information about the Boulder-pm mailing list