in reply to Help Matching Sections of a file
my $found_port; foreach my $line (@port_file) { if ($line =~ /^Port\s$port/) { $found_port = 1; $template{port_def} = $line; } next unless $found_port; last if $line =~ /^#----/; print $line; } [download]
-Mark