免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2034 | 回复: 4
打印 上一主题 下一主题

PerlScript 为什么不起作用于? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-01-28 13:49 |只看该作者 |倒序浏览
今天安装了一下ActivePerl , 试了下里面自带的例子.  
结果,
http://localhost/myweb/plmouse.htm 这样的地址, PerlScript的内容能够起作用, 如图1.jpg

http:// 主机ip(如172.20.1.20) /myweb/plmouse.htm 这样的地址, PerlScript的内容却完全不能够起作用, 如图2.jpg

我不知道为什么会这样? 望赐教, 谢谢!

说明 1, myweb是目录
     2, plmouse.htm 是写有perlscript代码的脚本, 代码如下



<HTML>
<!-- saved from url=(0017)http://localhost/ -->

<HEAD><TITLE>erlScript sample:  Mouse tracking</TITLE>
<link rel="stylesheet" type="text/css" href="../HTML/Active.css">
</HEAD>
                                          
<!--
        ActiveState PerlScript sample
        PerlScript:  The easiest, most powerful way to program custom web solutions.
-->

<BODY>
<TABLE CELLPADDING=0 BORDER=3 CELLSPACING=0>
<TR VALIGN=TOP ><TD>
<A HREF="index.htm" NAME="Image"><IMG SRC="SBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="The power of PerlScript!" BORDER=5></A><>
</TD></TR>
<FORM method="OST" NAME="MyForm1">
<TR VALIGN=MIDDLE><TD VALIGN=MIDDLE ALIGN=CENTER>
<INPUT TYPE="text" NAME="TxtLinkDescription" SIZE=50>
</TD></TR>
</TABLE>
</FORM>
<HR>

<>
&nbsp;<> Move your mouse over the PerlScript logo to see Image_MouseMove event parameters.


<SCRIPT language="erlScript">
sub Image_MouseMove {
    my ($x,$y, $s, $b) = @_;
    $window->document->MyForm1->TxtLinkDescription->{'Value'} = "MouseMove ss bb xx yy";
}

sub Image_mousemove {
    Image_MouseMove(@_);
}

sub Image_onmousemove {
    my $e = $window->event;
    my ($x,$y, $s, $b) = ($e->X, $e->Y, $e->OffsetX, $e->OffsetY);
    $window->document->MyForm1->TxtLinkDescription->{'Value'}
        = "MouseMove [X=$x Y=$y relX=$s relY=$b]";
}
  </SCRIPT>
<>


<!-- Horizontal line -->
<HR>

</BODY>
</HTML>

1.jpg (25.23 KB, 下载次数: 25)

1.jpg

2.jpg (24.26 KB, 下载次数: 24)

2.jpg

论坛徽章:
0
2 [报告]
发表于 2008-01-28 14:46 |只看该作者
手册上有这么个解释如下

位置 :  Windows Specific ----PerlScript ---

主题:
How can I configure client-side PerlScript security?

PerlScript in IE 4.0 and higher can be enabled/disabled by zones

HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\PerlScript\1.0
REG_DWORD: EnabledZones = 0x0010 (default)
Values

Enable All 0x0001
Enable Local 0x0010
Enable Internet 0x0020
Enable Trusted 0x0040
Note: By default, PerlScript is only enabled in IE's Local zone. Enabling PerlScript any other zones is not recommended. It allows websites to execute Perl code on the local machine as the current user.

按照上面的解释, 把键值改成 Enable All 0x0001  ,
本地的话, IE中打入 http://172.22.254.36/myweb/plmouse.htm  地址访问, Perlscript起作用了,
但是远程(用别人的电脑打这个地址)来做试验, 依然不能起作用.
依此做了几次实验, 将结果报告如下:

键值                                    本地IE中键入下列值结果(下3项)                     非本地IE 中测试结果
             http//localhost             http//127.0.0.1         http//172.20.1.32            http//172.20.1.32
Enable All                    ○                                   ○                                     ○                         ×
Enable Local                ○                                   ×                                     ×                         ×
Enable Internet           ×                                   ○                                     ○                         ×
Enable Trusted            ×                                   ×                                     ×                         ×


结论就是: 远程访问PearScript 代码脚本, 要有ActiveX scripting host . 所以这使PearScript 应用灵活性显得不够.

[ 本帖最后由 moonlit 于 2008-1-28 16:06 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2008-01-28 14:56 |只看该作者
原帖由 moonlit 于 2008-1-28 14:46 发表
手册上有这么个解释如下

位置 :  Windows Specific ----PerlScript ---

主题:
How can I configure client-side PerlScript security?

PerlScript in IE 4.0 and higher can be enabled/disabled by  ...


在hosts文件中加入172.22.254.36试试

论坛徽章:
0
4 [报告]
发表于 2008-01-28 16:16 |只看该作者
楼上, 谢谢
这个和host映射好象没有多大关系吧,
是PearScript没有被认识到啊.

论坛徽章:
0
5 [报告]
发表于 2008-01-29 09:29 |只看该作者
大家看一下手册上的这段话,
Note: By default, PerlScript is only enabled in IE's Local zone. Enabling PerlScript any other zones is not recommended. It allows websites to execute Perl code on the local machine as the current user.

不明白为什么默认方式是IE's Local zone.是什么用意呢?
默认为All 不是很方便很友好吗? 还说不建议这样的用法, 不明白了. 望高手指教.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP