Chuma has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks,
I have an HTML file showing a table, and I'd like to be able to edit parts of it. Naturally, you can't edit the table directly in the browser, so I figure I'll click a table cell and have Javascript pop up an input box, then pass that data to a Perl script which updates the underlying data file and the HTML. I could do that using CGI, but that seems like a strange way of doing it – I'm not going to put this functionality online, so why involve a server when all I want to do is edit my own files? But of course you can't run a local Perl script from a webpage, since that would be a security problem. So I'm trying to figure out a way to make Perl react to what's going on in the webpage.
So far my best idea is:
- have my Perl program running in the background
- on clicking a table cell, ask for user input with Javascript
- put that input plus a cell reference in an invisible text field
- copy that text to clipboard
- let the Perl script listen for changes to the clipboard, and use that to update the data files
Can you think of a solution that's less ridiculous?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Running local Perl from HTML
by choroba (Cardinal) on Mar 10, 2019 at 14:36 UTC | |
Re: Running local Perl from HTML
by haukex (Archbishop) on Mar 10, 2019 at 19:26 UTC | |
by Corion (Patriarch) on Mar 11, 2019 at 08:38 UTC | |
Re: Running local Perl from HTML
by Lotus1 (Vicar) on Mar 10, 2019 at 17:58 UTC | |
Re: Running local Perl from HTML
by clueless newbie (Curate) on Mar 10, 2019 at 16:41 UTC | |
Re: Running local Perl from HTML
by roboticus (Chancellor) on Mar 11, 2019 at 14:40 UTC |