Hi Luke,
It doesn't help, it is just a simpler solution. perlnewbie012215 says about 20 lines hence a simple solution might do the job as well.
BTW your code can be improved by checking the regexp match because it prints out the previous line if the pattern doesn't match:
if (/-S.+?($servname).+-D.+?($servname).+-C.+?($servname).+$/) {
print "Server after -S: $1; Server after -D: $2; Server after -C:
+$3;\n";
} else {
print "Unknown record structure: $_\n";
}
Or the important command line switches could be checked one by one and add them to the output if they exist.