in reply to Foreach loop help. Start from specific line
splice is a convenient way to remove things from the start of an array. For example, you could pass the start line as a parameter to your script and then use:
print "Skipping $count lines"; splice @lines, 0, $count; ... my $current_line_number = $count; foreach my $line (@lines) { print "Processing $current_line_number\n"; ... $current_line_number++; };
|
|---|