perl -ne "$i = 11 if /pattern/; if ($i) { $i--; print; }"