in reply to Loop Control

if( $i == 0 ) { for my $w ( @Nc ) { } } else { for my $w ( @Nc ) { } }

Or since the loops themselves are the same, differing only in their content:

for my $w ( @Nc ) { if( $i == 0 ) { # First pass actions } else { # Subsequent pass actions. } }

By the way, the code you posted doesn't compile.


Dave

Replies are listed 'Best First'.
Re^2: Loop Control
by slugman (Novice) on Jul 06, 2012 at 00:02 UTC
    Thank you Dave! For some reason, I forgot that I could use a if statement nested in the for loop. I'll need to remember that for the future. Also, I apologize that the code I posted didn't run -- thats what I get for copying and pasting from the original! Please take a look at my latest comment to the thread for the latest, as this actually runs! :)