#!/usr/local/bin/perl foreach $file (<*.htm*>) { open(HTFILE, ">>$file") or die ("can't open $file"); while () { chop; $notitle = 1; if (/^\/) { s///; s/<\/TITLE>//; print; $notitle = 0; last; # break out of this loop (file) } if (/^\<title\>/) { s/<title>//; s/<\/title>//; print; $notitle = 0; last; # break out of this loop (file) } } if ($notitle == 1) { print "*** No title found *** " }; close(HTFILE); print " ($file)\n"; }