Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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...

  • 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.

In reply to Re: help please by demerphq
in thread help please by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found