title: How to read multiple files from a directory, extract specific strings and ouput to an html file?
body: <p>Greetings, </p>
  
  <p>I have the following code and am stuck on how I would proceed to modify it so it will ask for the directory, read all files in the directory, then extract specific strings and ouput to an html file? Thanks in advance.</p>
  
  <pre><code>
  #!/usr/local/bin/perl
  
  use warnings;
  use strict;
  use Cwd;
  
  
  print "Enter filename: "; # Should be Enter directory
  my $perlfile =STDIN;      
  
  
  open INPUT_FILE, $perlfile || die "Could not open file: $!";
  open OUTPUT, '>out.html' || die "Could not open file: $!";
  
  
  # Evaluates the file and imports it into an array.
  my @comment_array = ;
  close(INPUT_FILE);
  chomp @comment_array;
  @comment_array = grep /^\s*#/g, @comment_array;
  
  my $comment;
  
  foreach $comment (@comment_array) {
          $comment =~ /####/; #Pattern match to grab only #s
  
  
  # Prints comments to screen
  Print results in html format
  
  # Writes comments to output.html
  Writes results to html file
  
  
  }
  
  close (OUTPUT);
  </code></pre>