in reply to Until there's nothing but spaces?
print if (/^Keyword$/../^\s*$/)||0 > 1 and /\S/;
OK, so what does this do. Well the .. operator will return false until the LHS is true. It then returns a true value, this value will initially be 1 but will increment each time, until the RHS becomes true. But it will return true on the line where the RHS is true, so we add the /\S/ check to prevent the output of the last line.
The || 0 is there as for false .. returns "", which -w will complain about.
|
|---|