By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,672 Members | 1,628 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,672 IT Pros & Developers. It's quick & easy.

Coursework - HTML Tags and Attributes to Uppercase

P: 2
i'm so glad i found this forum! i have to have some coursework done by the end of the week and i really need it explaining to me. i'm not really that big on stuff like this but it's a part of my web design course. i've found everything else pretty easy and enjoyable until i got baffled by perl.

anyway here's the task

"Create a Perl scirpt which converts HTML tags into uppercase for a given file. When run, the scirpt should prompt the user to enter the name of the HTML file. This name should be verified to ensure the file extension is either .html or .htm (upper or lowercase is acceptable) and if not an error message should be displayed and the user prompted to re-enter the name.

On input of a validated file name, the file should be processed (if it exists) and all lowercase tages, e.g. <html>, converted into uppercase, e.g. <HTML>. You should not convert and other text and should also avoid converting tag attribute values, e.g.
<img src="picture.jpeg">
should be converted to:
<IMG SRC="picture.jpeg">
rather than:

At the end of the processing, the original file should be renamed with the .old extension, instead of .htm/.html, and the processed file given the original file name."

if anyone could help me with any part of this i'd be very grateful. i don't want to outright cheat, i would actually like to understand what i'm doing.
where should i start? are my teachers asking too much of a beginner like me? i think they are!
Aug 27 '07 #1
Share this Question
Share on Google+
7 Replies

Expert 2.5K+
P: 4,059
You will want to use a regular expression to convert the tag names from lower to upper case. Lets see what code you have written so far.
Aug 27 '07 #2

P: 3
I think this is not too much difficult.. What u need to do is just

Converts all characters in the string to upper case.

uc Str

Takes a string and retruns it with the first character in upper case.

ucfirst Str1

Try this... and try to read String Functions.....
Aug 28 '07 #3

P: 2
i don't have anything written up to now. looks like i'm going to miss my deadline aswell. i have absolutley no idea where to start. this is like asking my mother to fix my car.
Aug 28 '07 #4

Expert 2.5K+
P: 4,059
No idea at all how to start? Is there no course material or teacher? If not, then what is the point of taking the course?
Aug 28 '07 #5

Expert 2.5K+
P: 4,059

we like people to show effort before posting solutions especially to their class/course work.

Aug 29 '07 #6

Expert Mod 2.5K+
P: 3,503
Unless of course your the person paying for their coursework and need to ensure that they pass.


Aug 29 '07 #7

Expert 100+
P: 1,089
The Coursework Posting Guidelines explicitly prohibit giving solutions to homework. You must attempt the assignment/program yourself first, and only post questions regarding any difficulties you have with specific parts that you have trouble implementing.

In this case, I suggest that you disect the problem into it's constituent parts and work on those. Can you get input from the command line? Can you validate that a file exists and is of type html? Do you know how to prompt for new input?

There are plenty of steps to this problem, but all of them are achievable by someone who puts the work into it.

Once you are ready, post a new question in this thread.

Aug 29 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.