473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

pass a perl variable to html

9
I am using a perl script to produce a six element array. When I click a string in the first element, I am linked to a html table (all.html) and the matching string is displayed in the first row of the html table.

This is the variable I am using in the perl script:

$ewstring= substr($string[$count - 1],3);

and this is the link to the html table (all.html):

$thisrow = $thisrow . "<td>" . $myfont . "<a href=/Operations/all.html#$ewstring style=text-decoration:none><font color=#000000>" . substr($string[$count - 1],3) . "</a>";

If I could have highlighted that matched value in the html table I would have done so, but I don't think that can be done in html. I was wondering if I could print that variable string outside the html table so that a user would see what string they selected.

Thanks.
Jul 13 '07 #1
8 5151
KevinADC
4,059 Expert 2GB
I am totally confused, could just be me, it's been a long week, but I have no idea what you are asking or trying to do.
Jul 13 '07 #2
roop1
9
Sorry for the confusion. I would like to pass a perl variable to a html table. In the example I included in my post, $ewstring (in my perl script) is the variable that stored the string that I would like to pass to the html table. Is that a little clearer?

Thanks.
Jul 16 '07 #3
KevinADC
4,059 Expert 2GB
If your perl script is generating and outputting the HTML code all you need do is insert your scalar into the HTML output:


Expand|Select|Wrap|Line Numbers
  1. my $foo = 'Hello World';
  2. print qq~<table><tr><td>$foo</td></tr></table>~; 
Jul 16 '07 #4
roop1
9
Thanks but I am still confused. If I may I will try to explain further.
These two lines in my perl script:

$ewstring = substr($string[$count - 1],3);
$thisrow = $thisrow . "<td>" . $myfont . "<a href=/Operations/all.html#$ewstring style=text-decoration:none><font color=#000000>" . substr($string[$count - 1],3) . "</a>";

produce the following table:

01TTERRORS_TCP_from_MIS Up Up 51 Jul 16 10:04:45 0
01TTERRORS_from_PHARM Up Up 0 Jul 16 08:01:37 0
01TTLABORDERADT_TCP_from_MIS Up Up 2326 Jul 16 14:14:05 0
01TTMSGS_eater Up - 51 Jul 16 10:04:45 0

When I click on say "01TTLABORDERADT_TCP_from_MIS" from the above table, then the following html table is displayed:

Dept Error Coverage Contact Notes
01TT-eater External: 01TTMSGS_eater 0900-1700 x 5 See DC.OPS.DOC@INTFACE
01TT-MIS External: 01TTERRORS_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTLABORDERADT_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTRESULTS_TCP_to_MIS 24 x 7 Tech Support on-call

I would like to print the string "01TTLABORDERADT_TCP_from_MIS" at the top of the html table i.e. above the column headings. Example:

01TTLABORDERADT_TCP_from_MIS
Dept Error Coverage Contact Notes
01TT-eater External: 01TTMSGS_eater 0900-1700 x 5 See DC.OPS.DOC@INTFACE
01TT-MIS External: 01TTERRORS_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTLABORDERADT_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTRESULTS_TCP_to_MIS 24 x 7 Tech Support on-call

Is this more confusing?

Thanks.
Jul 16 '07 #5
KevinADC
4,059 Expert 2GB
You seem to be quite confused. What are you expecting this to do?

<a href=/Operations/all.html#$ewstring

thaat just looks like an internal anchor that jumps to a certain part of the existing html page. It can't do anything besides that.
Jul 16 '07 #6
roop1
9
Exactly. That is all I want it to do, nothing else. However, I would like to print $ewstring on top of the existing html page, if that's possible.....Perhaps it's not.
Jul 17 '07 #7
KevinADC
4,059 Expert 2GB
It is possible but you would have to send the data back to the server, parse it, and reprint the page on the fly. Another possibility is to incorporate some DHTML/javascript into the html code that will handle the printing of the table name. But then you have the task of learnng DHTML/javascript and how to get it into your html output or asking on a DHTML/avascript forum (my javascript experience is very limited). A third possibility is AJAX, something I know next to nothing about.
Jul 17 '07 #8
roop1
9
Thanks for you help. I thought this would be a whole lot more than I can handle. But I needed confirmation.

Thanks again....
Jul 18 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: FLEB | last post by:
I like PHP for its excellent inline integration into standard HTML files, but I like Perl for its quick-moving syntax and simpler data-processing. To resolve this deep-seated inner turmoil (oh, the...
46
by: Reinhold Birkenfeld | last post by:
Hello, another Perl/Python question: the subject says it all. Perl is going to change dramatically to become a more powerful and easier to (read|write) language. Is Python taking a similar...
2
by: pleaseexplaintome | last post by:
Hi I have the following perl/cgi script snippet. The goal of this script is to pass a javascript variable to perl where it can be re-used later. Any help is appreciated, Thanks ...
0
by: alpha122 | last post by:
I am beginner and I need some help writing simple perl script. I need to get url query and pass it to the javascript function as parameter. for example: my page will be...
1
by: adpinc | last post by:
Hello all! I am a seasoned programmer, but not really with Javascript. I have a strange phenomenon going on that for the life of me I cannot figure out what is wrong. I am calling a javascript...
3
by: sisqorap | last post by:
Hi all, I have this kind of warning and would like to have it solved: Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration...
2
by: nriv08 | last post by:
Ok i've done lots of searching on google and i can't seem to find my answer. i have an html/php page that submits a string and stores it into a variable array via my php script. I want to pass...
66
by: happyse27 | last post by:
Hi All, my html code is sno 1) and perl code is sno 2). a) I tried to print $filename and it cant print out the value, only blank was displayed, and the file could not be uploaded. And it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.