in reply to Display Results

#!/usr/bin/perl use strict; my $file = "/usr/local/htdocs/SAR/sar.out.html"; open (SAR,">$file") or die "Unable to open $file!\n$!\n"; my $out = ""; my $header_count = 0; while (<DATA>) { # search for header, you could also use substr s!^(System Configuration:)!qq{<a name="spec}.++$header_count.qq{">$1 +</a>}!e; $out .= $_."<br>\n"; } my $header = ""; $header = $header.qq{ <a href="#spec$_">Spec $_</a><br>\n } foreach 1. +.$header_count; print SAR $header."\n<hr>\n".$out; close(SAR);