Good Day all. I am stuck with something. I am writing perl code that creates an XML file with alot of information. The one thing I need to do is to join points with a line, the XML code has an X and Y axle with which you just specify x=10 and y=11, this will create the point for location one. As this is completely dynamic, I do not want to hardcode the locations and instead want to create a has table or perhaps just a calculation to work out the next location. In other words I want to say
$X_initial = "80"; $Y_initial = "80";
So the first location for the first link will be at x80 and y80 but the following location should automatically use 80*2 and 80. In other words x160 and y80 and then the next 80 and 80*2 (x80 and y160) So the hash table should refer to using each only once and once it ahs reached the limit of the html display which could be 1138x638 it should create a new page and start from x80y80 again. here is an example of the how I write the XML using XML::Writer $writer->startTag("button", "name" => "foreshore", "label" => "Foreshore", "x" => "580", "y" => "528", "action" => "Active Zone"filter" => ", "target" => "_blank", "w" => "15", "h" => "15", "flash" => "false", "color" => "blue", "type" => "rounded"; So in essence I would like to replace the hardcoded "580" and "528" with the key that will auto select a location, but not reuse it. I hope it makes some sense.

In reply to Using a calculation to place locations by Hasharray

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.