in reply to call javascript from perl

Hi pvilleSE,

I notice that this is your first post (under this username at least), welcome to the Monastery.
Let us see if I am following this:

  • You have a web page which calls a Perl script


  • How is this being called? Server side include? A form which gets submitted, or a link that is clicked?.

  • The Perl script changes the contents of a file, and you wish to output the contents of said file to the screen
  • .

    I think the way I would do this would be not to use JavaScript to display the contents of a file, but to use Perl itself. Perl is more than capable of creating dynamic content driven html, meaning you could have a Perl script display a page with the content you wish already inside it. Have a look at CGI if you have not already done so. The Tutorials section of this site has many great tutorials on this and the use of html templating systems (and many other topics), which should help you in what you are trying to do.

    Should it be that I have missed the mark on what you are trying to achieve, let us know by providing a more detailed description of what you are trying to do (break it down step by step if you have to), and any code you already have.

    Hope this helps.

    Martin