PERL/JavaScript?

Is there a way to incorporate JavaScript, and PERL together on the same webpage? I tried doing the print>>EndofHtml
...and including Javascript in the html output, but it didn't seem to work.
Any help will be greatly appreciated.
Thanks!!
--------------booleanBill
booleanBillAsked:
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.

ozoCommented:
Assuming you meant print<<EndofHtml
what didn't work?
0
booleanBillAuthor Commented:
Opps! Yeah, I meant print<<EndOfHtml
Well for some reason, whenever I include (") quotes in my html output, it gets screwy. I have to do all my <font size=3> asignments without "'s .
But of course you can't do that with JavaScript.
0
ozoCommented:
Can you give an example of a (") that gets screwy?
Depending on the context, you may have wanted to use \" or &quot;
0
Redefining Cyber Security w/ AI & Machine Learning

The implications of AI and machine learning in cyber security are massive and constantly growing, creating both efficiencies and new challenges across the board. Join our webinar on Sept. 21st to learn more about leveraging AI and machine learning to protect your business.

booleanBillAuthor Commented:
Lets say I want to create a table to store the data in from a survey, so for instance:
#!usr/local/bin/perl

print "Content-type:text/html\n\n";

open(FROMFILE,"<guestdata.txt");

print<<EndofHtml;
<html><head><title>Survey results</title>
<script language="javascript">
<!--
some code
//-->
</script>
</head>
<body text="color" ect.....>
 see these quotes^ that's what I mean.
<table>
<tr>
<td>
EndofHtml
;
while(<FROMFILE>){
   print;
}

print<<EndofFoot;
</td></tr></table>
ect........


0
booleanBillAuthor Commented:
One more thing, I have seem other code that includes quotes, and it seems to work for them. I can't fugure it out. Must be something I'm doing.?????
0
ozoCommented:
Those quotes seem fine.  What problem are you having with them?
0
booleanBillAuthor Commented:
Well it just won't work, it says unterminated string constant ,or compilation error, or something!
I'm not even sure if it IS the quotes. But when I last had the problem I just took out the quotes and it worked again. But now, I can't do that, cause I need some JavaScript in there.
I also was wondering if there is a way to do this: (which is kinda what I really meant)
var img1 = new Image();
img1.src = $image;

I know THAT won't work. but you see what I mean , using a value from a perl program directly in a JavaScript. Or the other way around.
Is there a way to do that?

ps- I'd like to go ahead and give you the points. You've been so helpful.
0
ozoCommented:
It might help to know that the or something was.
but one possibility could be that there was extra blank space around the
EndofHtml
at the end, which kept it from matching the <<EndofHtml; at the beginning.

if $image is a perl variable, then
print<<EndofHtml;
<script language="javascript">
img1.src = $image;
</script>  
EndofHtml
will insert interpolate into the javascript code
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
booleanBillAuthor Commented:
Thanks ozo!! I'm sorry if I was a bit vague. I'm very new to the JavaScript, and PERL world. Acually I don't even know much about programming in general.
I just read articles, and tutorials online and attempt to do it myself, which has been pretty successful considering (i'm inexperienced), You can visit some of my attempts if you'd like
http://jodellah.virtualave.net/kellycode/

Thanks!!
0
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
Web Development Software

From novice to tech pro — start learning today.