Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Just another Perl shrine
 
PerlMonks  

Comment on

( #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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (4)
    As of 2014-04-18 10:49 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (466 votes), past polls