cgi perl script

Hello,

I am trying to make modifications to a perl script in order to make it responsive to screen resolutions.

Here is an excerpt:

<tr>
<td colspan="2"></td>
<td colspan="2" style="color: #d00; text-align: left; font-weight: 700; line-height: 16px;"><!--ERROR--> </td>
</tr>			
<tr>				<td height="20" colspan="4"> </td>			</tr>
<tr>
<td colspan="2"></td>
<td colspan="4" style="text-align: left; padding-right: 0;"><font color="#c00000">*</font> Required fields</td>
</tr>			
<tr>				<td height="10" colspan="4"> </td>			</tr>
<!--NAME--><tr>
<!--NAME--><td class="txr"><!--FFN-->Name:</td>
<!--NAME--><td></td>
<!--NAME--><td class="txl"><input type="text" name="name" value=""><!--FN--> <font color="#c00000"><!--NAMER--></font></td>
<!--NAME--></tr>
<!--AGE--><tr>
<!--AGE--><td class="txr"><!--FAGE-->Age:</td>
<!--AGE-->	<td></td>
<!--AGE--><td class="txl"><input type="text" name="age" value=""><!--AGE--> <font color="#c00000"><!--AGER--></font></td>
<!--AGE--></tr>

Open in new window


I was under the impression that words enclosed in <!----> were simply comments. I found out that this wasn't the case, when I deleted <!--error-->, and the errors stopped showing up.

So therefore I assume that <!----> is for variables?

What could <!--NAME-->, <!--NAMER-->, <!--AGE-->, <!--AGER--> be doing? It doesn't seem to be making any difference at all when I remove them.

thanks for our help!
netplus21Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FishMongerCommented:
Your question and your code don't have anything to do with Perl.  That is html code and the parts you're referring to are html comment tags.
0
netplus21Author Commented:
Hello,

Allow me to clarify further.

The above code is from a .txt file in a templates directory.

The '<!--error-->' tag produces actual errors, as mentioned in my previous post, it's not a comment tag.

Here is an instance of the '<!--error-->' tag in the main perl script.

open ( IN, "$template_path$page") or die $!;
				while ( <IN> )		{
					s/<!--Error-->/$message/;
					s/<!--MESSAGE-->/$message/;
					print $_;
				}
			close IN;

Open in new window


and also

s/<!--ERROR-->/ $message/ if $message;

Open in new window


and also

while ( <IN> )		{
				s/<!--Error-->/$message/;
				s/"><!--UN-->/$user_name">/ if $user_name;
				s/"><!--PW-->/$password">/ if $password;
				print $_;
			}

Open in new window



Here are some instances of '<!--NAME-->' and '<!--NAMER-->' that show up in the the main perl file, together with other sign up form tags.

while ( <IN> )		{
				next if /<!--NAME-->/ and $specs[0] eq 'no';
				next if /<!--AGE-->/ and $specs[1] eq 'no';
				next if /<!--GENDER-->/ and $specs[2] eq 'no';
				next if /<!--COUNTRY-->/ and $specs[3] eq 'no';
				next if /<!--CITY-->/ and $specs[4] eq 'no';
				next if /<!--NEWS-->/ and $specs[5] eq 'no';
				s/<!--NAMER-->/*/ if $specs[0] eq 'mandatory';
				s/<!--AGER-->/*/ if $specs[1] eq 'mandatory';
				s/<!--GENDERR-->/*/ if $specs[2] eq 'mandatory';
				s/<!--COUNTRYR-->/*/ if $specs[3] eq 'mandatory';
				s/<!--CITYR-->/*/ if $specs[4] eq 'mandatory';
				s/<!--NEWSR-->/*/ if $specs[5] eq 'mandatory';
				print $_;
			}

Open in new window


My question remains, whether it's alright, to remove tags similar to '<!--NAME-->', from the txt file, since they don't seem to be doing anything at all.
0
ozoCommented:
If a perl script opens the txt file to <IN>
and executes
 while ( <IN> ){
				next if /<!--NAME-->/ and $specs[0] eq 'no';

Open in new window

then removing '<!--NAME-->' from the file can change what the perl script does.
especially if $specs[0] eq 'no'
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CGI

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.