从HTML页面运行Perl程序,无需用户干预 [英] Run a Perl program from an HTML page without user intervention

查看:50
本文介绍了从HTML页面运行Perl程序,无需用户干预的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候!


我以为我会在网站上添加一些东西,一周的提示,并且希望它自动化,这样如果我被卡车击中(或者更可能是健忘),提示会自动更新。


我学到了足够多的Perl(阅读:足够了)来编写一个执行我想要它的脚本。现在的问题是:如何让它自动运行。


我希望当有人,任何人点击我的主页时调用该程序。我对我们的环境知之甚少 - 我不是开发人员 - 但我知道我在Windows机器上并且我们正在运行IIS。服务器端包括工作。 Perl用于表单工作。除此之外,我必须为我的无知道歉。


我试图在我的HTML页面上使用#exec命令来调用Perl脚本。不行。这是我的测试页面的HTML:

Greetings!

I thought I''d add a little something to a web site, a "tip of the week," and wanted it automated so that if I get hit by a truck (or, more likely, am forgetful), the tip is updated automatically.

I learned enough Perl (read: just enough) to code a script that does what I want it to do. Now the question is: how to get it to run automatically.

I would like the program to be invoked when someone, anyone, hits my homepage. I know little about our environment -- I''m not a developer -- but know that I''m on a Windows box and that we''re running IIS. Server-side includes work. Perl for use with forms works. Beyond that, I must offer my apologies for my cluelessness.

I''ve tried to use the #exec command on my HTML page to invoke the Perl script. Doesn''t work. Here''s the HTML to my test page:

展开 | 选择 | Wrap | 行号

推荐答案

使用虚拟SSI标记而不是exec,您需要使用脚本的相对URL,而不是内部机器路径:


<! - #include virtual =" ../ CGI / tipweek.pl" - >


看看它是如何工作的
use the virtual SSI tag instead of exec and you need to use the relative url to the script, not an internal machine path:

<!--#include virtual="../CGI/tipweek.pl" -->

see how that works


谢谢!我试过了,并得到处理SSI文件时出错。


我也试过<! - #exec virtual =" CGI / tipweek.pl" - >,这给了我无效的SSI标记。


和<! - #exec" CGI / tipweek.pl - >",它没有给我一个错误信息,但也没有更新文件。


后者让我觉得它可能是一个文件权限问题,因为我之前遇到过这个问题(Perl脚本显然在运行,但文件中没有出现任何应该出现的更改被改变了)所以我写了一个小的测试脚本来写入文件,这很有效,所以权限很好。


我愿意接受建议!哎呀,在这一点上,我非常渴望得到建议!我正准备烧黑蜡烛,甚至牺牲一只山羊! Oy !!
Thanks! I tried that, and get "Error processing SSI file."

I also tried <!-- #exec virtual="CGI/tipweek.pl" -->, which gives me "Invalid SSI Tag."

And "<!-- #exec "CGI/tipweek.pl" -->", which doesn''t give me an error message, but also doesn''t update the files.

This latter made me think it might be a files permissions problem, as I''ve had that problem before (a Perl script apparently running, but no changes appearing in the file that should be changed), so I wrote a little test script to write to the files, and that worked, so the permissions are fine.

I''m open to suggestions! Heck, at this point, I''m desperate for suggestions! I''m at the point where I''m ready to burn black candles and sacrifice a goat, even! Oy!!





尝试
Hi,

try
展开 | 选择 | 换行 | 行号


这篇关于从HTML页面运行Perl程序,无需用户干预的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆