in reply to Execute a Perl script in a browser

"browser asks me if I want to open the file or save it... Instead I want it to be executed." As an experiment, I pointed my Firefox browser at a Perl script. There is no "execute" option, but under "open", one of my options under Windows is "Perl Command Line Interpreter (default)" amoungst Notepad and other "open options" for this xxx.pl file. A command line window pops up, script runs and then command line window disappears. Of course my script doesn't generate any HTML or launch a webpage, but I suppose that is possible. Anyway if you "open" the file with Perl, it will be executed.

I don't know that this tid-bit of info helps you. I think something more sophisticated as choroba suggests is what you need? Oh, there is also a way to control Firefox from Perl, WWW-Mechanize-Firefox. That might have some relevance?

Replies are listed 'Best First'.
Re^2: Execute a Perl script in a browser
by federico-perlmonks (Novice) on Apr 21, 2016 at 15:03 UTC

    I managed to run the script doing what you said, but it opened another window, while I was hoping that it acted more like some links you find in the web pages: you click, the program is executed and the server sends you another page, with the output (for example, when you register to a forum...). I'm sorry I did not explain this better in the post.

    The option to mechanize firefox is interesting, I'm sure I will find something useful.