Short answer: Write a Java applet if you want something to work like that. You can send XML from your Perl script to the Java program, which could presumably display it. This isn't easy though. It sounds like the Golden Hammer of solutions, in other words, a waste of time.

Long answer: Make a bigger map and label it so that it makes sense as to what people are looking at. Also, you can easily generate JavaScript code from within Perl. With that in mind, you can export a JavaScript array which would have coordinates and town names. You can't "call" Perl from within JavaScript, because there is no Perl. There is only a Web server somewhere, with Perl running on it.

As long as the page you're talking about can be converted into a Perl-generated one, then you have a lot of ways you can go about solving this problem.

In reply to Re: Calling a perl function from within a javascript function by tadman
in thread Calling a perl function from within a javascript function by Baz

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.