Loading ...
Sorry, an error occurred while loading the content.

Re: Filtering out ads from egroups lists

Expand Messages
  • wlperkins66
    Yeah, there are a couple of better ways, but first, if you are going to use a counter to skip some lines, it is safer to test for >0 instead of =0. In more
    Message 1 of 976 , Sep 7, 2000
    • 0 Attachment
      Yeah, there are a couple of better ways, but
      first, if you are going to use a counter to skip some
      lines, it is safer to test for >0 instead of =0. In
      more complex code, it is all too easy to get stuck in
      an endless loop because your counter went below
      zero.<br><br>And speaking of style, I prefer to put braces at the
      end of preceeding lines if it's visually redundant as
      a delimiter. But if it's the only delimiter you've
      got, go ahead. For example:<br>#while (<INFILE>)
      {<br>or<br>#}else{<br><br>But, to answer your question, try this. It strips out
      all blank lines.<br>if (length $_ < 5)
      {<br>next<br>}else{<br>print OUTFILE "$_";<br>}
    • Ubercat
      Hi there. I m trying to make a global hash in a use strict Perl program for a school assignment, and I declared a hash outside of any
      Message 976 of 976 , Feb 27, 2002
      • 0 Attachment
        Hi there.<br><br>I'm trying to make a global hash
        in a use strict Perl program for a school
        assignment, and I declared a hash outside of any
        blocks...<br><br>my %names<br><br>I have declared several global
        arrays, but the global hash isn't working out as well. I
        keep getting "requires explicit package" errors when
        the program has to use the $names{key} form. How dfo
        I get around this so that the hash reference is
        also recognized by the program?
      Your message has been successfully submitted and would be delivered to recipients shortly.