in reply to Re: Re: Re: Correct Loop Structure
in thread Correct Loop Structure

Well done Not_a_Number++, I totally missed that (of course, since I didn't test it, no wonder!).

To prove that in perl you can do things more than one way, this would also work:
( print OUTFILE if (/\;drop;[^"]*$i/) ) && $newIPseen{$i}++;
    although I do prefer using ++$newIPseen{$i};.

update: mark this day my friends, I was wrong!*



*not a day has gone by when arden wasn't wrong about something

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Correct Loop Structure
by ysth (Canon) on Jan 30, 2004 at 00:17 UTC
    The postfix "if" is called a statement modifier becauses it modifies a statement; you can't use it within an expression like that. The above gets a syntax error.

      Well then...

      do { $test = 2 > 1; print 'foo' if $test; $test; } && $index++;

      ...but that is just oogly.