#!/usr/local/bin/perl -w print "Content-type:text/html\n\n"; #Content Header open(TOP, "first.htm"); # Open db for reading and display @farray=; close (TOP); open(BOTTOM, "second.htm"); # Open db for reading and display @sarray=; close (BOTTOM); foreach $sline(@sarray){ chomp($sline); print "second $sline \n"; if (index ($sline, "pattern") > "-1") { foreach $fline(@farray){ chomp($fline); print "first $fline \n"; if ($fline =- /go/) {print "hello";} print "first $fline \n"; } } }