You've got subs, fantastic, now make them take parameters :) don't hardcode filenames
speaking of filehandles, you can also use open my $foo, '<', ..., you don't have to use globals like FH1
error checking is for everyone, even you can use autodie, or better still use Path::Tiny
readdir is not for you, its like making your own stone/axe, when you already have swiss army chainsaw ... use Path::Tiny and/or File::Find::Rule; examples can be found with find/rule and path tiny links
long if/else @ARGV option scan is busy work :) use perl -s or even better use Getopt::Long which allows you to use lexical variables not just globals
so i think it is use Cwd; , not i don't want to use other modules, but my assignment only allows me to use that 3 modules.
right now i having problem to make assignment1.pl -fh to be able to redirected into a file and view from the web browser.