SID-00790: Add a button that opens a perl script
| Status: |
Answered |
TWiki version: |
4.1.2 |
Perl version: |
|
| Category: |
CategoryAutomation |
Server OS: |
RHEL 4.8 kernel 2.6.9-89 |
Last update: |
15 years ago |
Hello,
we are using svn as a collaboration tool, and some of the documents we write in svn are copied to Twiki and should be synchronized. We already have a perl script that updates the content of Twiki pages with latest modifications from svn.
What I would like to have now is a "Refresh" button on a Twiki page. When a user would click on this button the perl script would be called to refresh the Twiki pages with latest svn content.
How do I create such a command? I'm very new to Twiki, I've played a little bit with text editing commands but I don't know a lot about it!
--
SophiePasquier - 2010-03-22
Discussion and Answer
Create a CGI wrapper for your script. See
Google:perl+hello+world+cgi
. From that script you can call your update script. For example, in Perl you can invoke an external script using backticks, such as:
my $output = `/var/www/tools/update_stuff.pl`;
--
PeterThoeny - 2010-03-22
Thanks a lot Peter!
--
SophiePasquier - 2010-03-25
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.