Hi monks I am trying to create an image map by using Perl and JavaScript. I have got many points to use in my image map so i thought an implementation in Perl could help as i couldn't really tihnk of any other solution. Anyway here is the code:
## Previous code to find x coordinates, y coordinates ## and website names my @x_points; my @y_points; my @websites; my $secondcount; <IMG SRC="figure.gif" USEMAP="#mymap"> <MAP NAME="mymap"> for ($secondcount=0; $secondcount < $webpage_no; $secondcount++) { <AREA SHAPE=circle COORDS="'$x_points[$secondcount],$y_points[$se +condcount],1" HREF="'$websites[$secondcount]"> } </MAP>
The problem is that i get errors at the line where i have the for loop. The errors are:

syntax error near ++) and

Syntax error near "for"

Also, even if those two problems are solved do you reckon the code will do what i want? That is, for say $x_points[0], $y_points[0] and $websites[0] then the coordinates will be the first two variables and the website they link to will be the $websites[0] variable. Thanks for looking and your replies


In reply to Creating an image map using Perl code by lampros21_7

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.