Thanks for the help guys. I got this thing working. I will post my modified code. Since I am new, I will look around and see, if I can post the source so someone else can benefit. Thanks!
# Variables $output = "/home/web/path/to/foo/foo.htm"; $jscriptdir = "/home/web/foo/javascript/"; $javadir = "/home/web/foo/servlet/"; $cgidir = "/home/web/cgi-bin/"; # Open the output file open(NEW,">$output") or die "Can't Open $output: $!"; print NEW "<html><head><title>Comment Extractor</title></head>\n"; print NEW "<body>\n"; print NEW "<h1>Comment Extractor</h1>\n"; print NEW "<hr>\n"; # Let's find files. Call jsfind for the dirty work find (\&jsfind, $jscriptdir); print NEW "</body></html>\n"; close NEW; exit; sub jsfind { # get all file names that have last 2 characters "js" if($File::Find::name=~/\.js$/) { # ignore js files in those stupid Frontpage _vti* directories if ($File::Find::name=~/\_vti/) {} else { # get name of script file and print it in red $script_title = $_; print NEW "<b><font style=\"color:red; size:16px; text-tra +nsform: uppercase\">" . $script_title . "</font></b>"; # placeholder for file # start opening files to read open(FILE, $File::Find::name) or die "could not open f +ile - $_ - : $!"; # iterate thru files to find match //** while (<FILE>) { if ($_ =~ /\*\*/) { # print files to $output print NEW substr($_,4) . "<br>"; } } close FILE; } } else { return; } }

In reply to Re: Find, read, write out contents of a certain file type recursively... by Ro
in thread Find, read, write out contents of a certain file type recursively... by Ro

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.