in reply to Capturing parentheses out of scope

You could assign them (i.e. $1..$N) to an array declared in the outer scope — or in the if-scope: if (my @f = /...

But what would you expect them to hold if the regex doesn't match? Or is it only the second test (and ( !/numsnp=[1-4]\s+/ )) that is expected to fail in these cases?

Replies are listed 'Best First'.
Re^2: Capturing parentheses out of scope
by iangibson (Scribe) on Jan 20, 2011 at 21:10 UTC

    To clarify: every line will match the first regex, so only the second test is important in distinguishing the two groups of lines (as you suggested). I'd like the rejected lines to go into a file in the same format as the successful lines so I can visually check that nothing was rejected that shouldn't have been.