When you are starting out with any language you can get a "blank screen" syndrome. The trick is to break the problem down into small chunks. I suppose I could write the script for you, but instead I'm going to suggest an approach you might like to take so you can begin learning more of the language.
You have a fairly clear spec on what you need, so start by taking that spec as a set of comments. Now "fill in the blanks" using your research and the online documentation, always remembering that "There's more than one way to do it":
# prompt the user to enter the name of a HTML file. Use print, the read from STDIN # The file will need verifying to check that the file extenstion is # .html or .htm (upper case or lower case is fine). Use a regular expression or string comparison # Upon input of the validated name the file needs to be processed Open the file Read each record in a loop # and all lowercase tage, e.g (<html>) need converting to # uppercase (<HTML>), # no other text should be converted You could craft a regular expression, but also checkout the many HTML +helper modules on CPAN # also tag attribute values need to remain, # e.g (<img src="picture.jpg"> should convert to # <IMG SRC="picture.jpg"> and not <IMG SRC="PICTURE.JPG">. likewise # At the end of the processing, the original file needs to be renamed # with the .old extension instead of .htm or .html # and the processed file should be given the original file name. Generate the new filename, then use rename

Now when you need more specific help with each section you can look up the online documentation and web resources, including SuperSearch.

In reply to Re: Converting HTML tags to upper case by cdarke
in thread Converting HTML tags to upper case by Bern

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.