use strict; use warnings; my $nav_seen =0; while () { # if inside of section, print it # unless we have seen a section before if (my $status = /