For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2006 > Using java in perl









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using java in perl
Edjacob

2006-09-24, 9:57 pm

Hi,

I'm a newbie to both Perl and this list, so I hope this question and the
way I've asked it are okay.

I am trying to get my Perl script to produce the following Java. I

<p onclick="FP_openNewWindow('400', '200', false, false, false, false,
true, true, '',
/*href*/'http://images.google.com/images?q=/query/')">/query/</p>

It's not working and I'm guessing that it might be because the query
(q=$word1) is on a new line instead of being attached to the rest of the
tag.

I'm producing the script inside a table with this Perl code:

print <<ENDHTML;
<p onclick="FP_openNewWindow('400', '200', false, false, false, false,
true, true, '', /*href*/'http://images.google.com/images?q=
ENDHTML
print "$word1";
print <<ENDHTML;
')">
ENDHTML
print "$word1";
print "</p>";

This is the source code that I get (there are some Japanese characters
in here so it may show up as garbage text):

<BODY><H2>This is a test</H2>listname=animalsanimalsanimals.txt<table border="1" cellpadding="5" cellspacing="5" id="table1">
<tr><td><p onclick="FP_openNewWindow('400', '200', false, false, false, false, true, true, '', /*href*/'http://images.google.com/images?q=
?')">
?</p></td><td><p onclick="FP_openNewWindow('400', '200', false, false, false, false, true, true, '', /*href*/'http://images.google.com/images?q=
/s dog
')">

dog
</p></td>

Am I right that all Javascript tags have to go on one continuous line?
If so, is there an easy way to fix my perl code so that it joins up?

This script is online at: http://www.amapro.jp/cgi/execexec.htm. It
doesn't produce errors, but it doesn't work. (What I'm trying to do is
make a list of words where if you click on them, it will do an image
search in google and display it in a pop-up window).

Thanks in advance.

Ed Jacob
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com