免费注册 查看新帖 |

Chinaunix

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

使用perl2exe编译后不能运行 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-18 15:09 |只看该作者 |倒序浏览
5可用积分
pl运行正常,编译没出错,但运行编译后的exe文件就出错。
google了一下:not allowed while "strict subs" in use
也没发现有好的解决方法

D:\web\soft\htool\perl2exe>22.pl
=============================================================================
                      Account scanner
                  Codz By N3tl04D  2009-08-17
Syntax: D:\web\soft\htool\perl2exe\22.pl openfile savefile

=============================================================================

D:\web\soft\htool\perl2exe>perl2exe -o 22.exe 22.pl
Perl2Exe V8.80 Copyright (c) 1997-2006 IndigoSTAR Software
Registered to n3t:n3t:20090718, ENT version
Converting '22.pl' to 22.exe

D:\web\soft\htool\perl2exe>22.exe
Bareword "Internals::inc_sub_generation" not allowed while "strict subs" in use
at PERL2EXE_STORAGE/constant.pm line 112.
Compilation failed in require at PERL2EXE_STORAGE/Time/Local.pm line 28.
BEGIN failed--compilation aborted at PERL2EXE_STORAGE/Time/Local.pm line 28.
Compilation failed in require at PERL2EXE_STORAGE/HTTP/Date.pm line 12.
Compilation failed in require at PERL2EXE_STORAGE/LWP/UserAgent.pm line 14.
BEGIN failed--compilation aborted at PERL2EXE_STORAGE/LWP/UserAgent.pm line 14.
Compilation failed in require at PERL2EXE_STORAGE/LWP.pm line 10.
Compilation failed in require at D:\web\soft\htool\perl2exe\22.exe line 4.
BEGIN failed--compilation aborted at D:\web\soft\htool\perl2exe\22.exe line 4.

D:\web\soft\htool\perl2exe>


代码如下:
  1. #!/usr/bin/perl

  2. use strict;
  3. use LWP;
  4. use Crypt::SSLeay;
  5. use HTTP::Cookies;
  6. use HTTP::Request::Common qw(POST);

  7. my $user;
  8. my $pass;
  9. my $count;


  10. &usage if @ARGV!=2;
  11. my $openfile=$ARGV[0];
  12. my $savefile=$ARGV[1];

  13. my $ua=new LWP::UserAgent;
  14. $ua->agent('Mozilla/5.0');
  15. $ua->cookie_jar(new HTTP::Cookies);
  16. sub login{
  17.     my $test1=$ua->request(POST 'https://logins.baidu.com/Mail-bin/login.cgi',
  18.     [
  19.     "url"=>"http%3A%2F%2F[url]www.baidu.com[/url]%2F%3Ft__nil_top%3Dlogin",
  20.     "pw"=>"$pass",
  21.     "id"=>"$user",
  22.     "enpw"=>"$pass",
  23.     "login"=>"%EB%A1%9C%EA%B7%B8%EC%9D%B8",
  24.     "saved_id"=>"on",
  25.     "Referer"=>" [url]http://www.baidu.com/?t__nil_top=logout[/url]",
  26.     ]
  27.     #)->as_string;
  28.     );
  29. #my $content=$test1->content;
  30. #print "$content";
  31. }

  32. readfile();

  33. sub readfile {
  34.     open(FILE,$openfile);
  35.     open(SAVEFILE,">>$savefile");
  36.     while(<FILE>)
  37.     {
  38.         chomp;
  39.         $_ =~ m{(.+?)\s(.+)}gi;
  40.         $user=$1;
  41.         $pass=$2;
  42.         print "Trying user:$user    ";        
  43.         login($user,$pass);
  44.         gethtml();
  45.     }
  46.     close(FILE);
  47.     close(SAVEFILE);
  48. }


  49. sub gethtml {
  50.     my $url="http://www.baidu.com/?t__nil_top=login";
  51.     my $getpost=POST($url);
  52.     my $html=$ua->request($getpost)->as_string;
  53.     if ($html =~ m{<span>(\d+\,?\d+\,?\d+)<\/span>}gi) {
  54.                 $count=$1;
  55.     } else {
  56.                 $count="Unknow";
  57.         }       
  58.         print "get count $count\n";
  59.     print SAVEFILE "user:$user    pass:$pass    count:$count\n";
  60. }


  61. sub usage {
  62.         print <<"USAGE";
  63. =============================================================================
  64.                       Account scanner
  65.                   Codz By N3tl04D  2009-08-17
  66. Syntax: $0 openfile savefile

  67. =============================================================================
  68. USAGE
  69.         exit 0
  70. }
复制代码

论坛徽章:
0
2 [报告]
发表于 2009-08-18 16:57 |只看该作者
改用 pp 或者 pdk(需注册)

perl2exe不是很好用

论坛徽章:
0
3 [报告]
发表于 2009-08-18 17:05 |只看该作者
去掉所有用到的模組中的
use strict;試試

[ 本帖最后由 lokchungk 于 2009-8-18 17:10 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2009-08-18 22:11 |只看该作者
去掉use strict也不行

论坛徽章:
0
5 [报告]
发表于 2009-08-19 00:10 |只看该作者
原帖由 n3tl04d 于 2009-8-18 22:11 发表
去掉use strict也不行


連這幾個包中的 use strict; 也去掉了嗎?
constant.pm
Time/Local.pm
HTTP/Date.pm
LWP/UserAgent.pm
LWP.pm

论坛徽章:
0
6 [报告]
发表于 2009-08-20 11:05 |只看该作者
原帖由 lokchungk 于 2009-8-19 00:10 发表


連這幾個包中的 use strict; 也去掉了嗎?
constant.pm
Time/Local.pm
HTTP/Date.pm
LWP/UserAgent.pm
LWP.pm


去掉了,也不行。

论坛徽章:
0
7 [报告]
发表于 2009-08-20 11:06 |只看该作者
原帖由 hitsubunnu 于 2009-8-18 16:57 发表
改用 pp 或者 pdk(需注册)

perl2exe不是很好用


PP安装不成功。

C:\Perl\bin>ppm-shell
ppm 4.01
Copyright (C) 2007 ActiveState Software Inc.  All rights reserved.
ppm> install PAR
Downloading ActiveState Package Repository packlist...done
Updating ActiveState Package Repository database...done
Downloading PAR-0.994...done
Unpacking PAR-0.994...done
Generating HTML for PAR-0.994...done
Updating files in site area...done
  14 files installed

ppm> exit


C:\Perl\bin>pp
'pp' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

C:\Perl\bin>

论坛徽章:
0
8 [报告]
发表于 2009-08-20 11:26 |只看该作者
perl 5.10


  1. ppm install PAR

  2. ppm install PAR::Packer

复制代码


path

  1. C:\Perl\site\bin\pp

  2. pp -o t.exe t.pl
复制代码

论坛徽章:
0
9 [报告]
发表于 2009-08-25 15:30 |只看该作者
装PDK,晚上google注册码,然后用perlapp  xxx.pl就行了,很好用。
我这面带ODBC,带mysql的DBI,都可以编译进去,只是.exe文件有5M多了。
否则,一般在800K左右
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP