I am trying to setup a page on my website that is basically a journal system that manages my entries. I have the page split into two parts, one containing the most recent entry and the other containing links to previous entries. I was planning on storing the entries in seperate folders by month, so that I could write a perl script to grab all of the files in a certain directory and then create links to them. That's the easy part.

The second part of what I am trying to do involves dynamically updating parts of the page. I want the user to be able to click one of the side links and have the entry that he/she clicked overwrite the text for the current post. I know how to do update dynamically using Javascript, but is it possible to use perl to grab the text contained within the specific file? Somehow pass the contents back to the Javascript?

Also, I was only planning on having the posts for the current month being shown in the menu with links back to the past two months as well. What I want to happen is that when the user clicks on a certain month, the script will grab the files in that month's directory and display links to them. Is there a way for Perl and javascript to interact to accomplish this or would I be better of just using perl and refreshing the page automatically?

If this is the case, what would be the best way to pass hidden parameters to the perl script that won't appear in the URL. I only want www.abc.com/index.pl?node=xxx to show up as the url.

Thanks

In reply to dynamic update javascript & perl? by emilford

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.