Despite agreeing with Snuggle regarding Homework you have at least been honest (most arent) and have made an attempt (even if it is a partial attempt.) So heres some thoughts...
in reply to help please
The script is to take as an argument a directory. It is to search the directory's files and perform the following.
This sounds much like what File::Find takes as a parameter and what it is used for
- htm files are to be renamed html.
Perhaps the rename keyword would be useful, consult perlfunc.
- any references to http within an htm/html file are to be changed to https.
Personally I would do this with HTML::TreeBuilder or alternately with HTML::TokeParser theres an excellent tutorial on using the later here<super>(fixed link sorry.)</super>
- any html tags within html files are to be converted to upper case
Sounds like learning one of the HTML modules really could pay off...
- (you may assume that <>s are used exclusively to identify html tags)
this may be true for your assignment but is patently and absolutely not true of real life. Impress your teacher use one of the HTML modules
- record in a log file each file that has been modified.
Might want to look up print open and close in perlfunc as well.
- Additional tasks for additional credit
- Your script is to work recursively through any sub-directories.
Yup, the time you took to learn File::Find is gunna score you bunch of bonus points on this one boy...
- Your script will not convert to upper case any SRC attributes of a tag.
Strange how learning one of the HTML modules will pay off in the long run isnt it?
- Your log file will record each tag converted by your program.
Hmm, youll have lots of time to figure out the best way to do this because of the well spent time you put into learning the HTML modules.
- Data validation (really this should be part of the main spec!!!!)
Hmm, aftering mastering a couple of modules validating a path (the only user input) shouldn't be any trouble at all!
Ok its a little tongue in cheek, but I think you get the idea... ;-)
Good luck! And dont forget to use strict and warnings, to have a read through perlfunc, and perhaps perlopentut
Yves / DeMerphq
Writing a good benchmark isnt as easy as it might look.