我要疯了,谁能解决这个问题,我给谁500分!决不食言!其余的分数随后补上。

milson 2001-07-02 05:46:13
怎么在windows系统下调试多文件的perl工程。我用的是perl builder,已经安装了apache for windows,perl for windows。为什么还是不行啊?
...全文
198 25 打赏 收藏 转发到动态 举报
写回复
用AI写文章
25 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangsw 2001-07-07
  • 打赏
  • 举报
回复
PERL,没用过!
xxxbird 2001-07-03
  • 打赏
  • 举报
回复
>> If you are using a "require" statement, you cannot specify a path. Use the syntax "require 'libfile.pl' ; "and place the libfile.pl file in the same directory as your script.
前一句是对的,"and"开始的后半句可能有问题,实际上源文件并不一定要放在同一目录下。
xxxbird 2001-07-03
  • 打赏
  • 举报
回复
当然可以呀。上面不是已经说得很清楚嘛。你要将它们都在Perl Builder中打开,并且在require中不要指明路径。你可以通过 $::PERLBUILDER 标志来区分是否在Perl Builder中执行(有点相当于其它语言中的条件编译)。
xxxbird 2001-07-03
  • 打赏
  • 举报
回复
下面是我从Perl Builder 的 FAQ中抄过来的,现在我全明白了:

Why doesn't Perl Builder step into a routine in another module or library?

If you have difficulty stepping into (or stopping at a breakpoint within) a module or library, please check the following:

The module or library must be open in the IDE before you start debugging. Perl Builder will not open the file automatically. Note that the subroutine will still be executed whether the module is open or not. However, if you want to step into it with the debugging commands, it must be open in the IDE.
Debugging must be enabled for the module. If the module has a standard Perl extension, such as .pl, .pm, etc, debugging will be enabled by default. If you are using another extension, you will need to enable debugging by opening the Module list and checking the box for the file at the bottom of the window. To open the Module List, choose View Module List from the File menu.

If you are using a "require" statement, you cannot specify a path. Use the syntax "require 'libfile.pl' ; "and place the libfile.pl file in the same directory as your script.
If you are using something like, "use xxx::yyy", Perl Builder will support up to 3 levels. You will not be able to step into something like "www::xxxx::yyyy::zzz".
Modules and their locations must be specified in your code with constructs such as "use" "require", "uselib", etc. Perl Builder does not support using command line switches for this.

If any of the above require you to modify your code, you can use the $::PERLBUILDER flag to determine whether you are running in Perl Builder and execute different code accordingly.



milson 2001-07-03
  • 打赏
  • 举报
回复
难道我把源文件放到不同的目录就不能调试了吗?我想肯定还是有办法的,大家帮我想想啊!
milson 2001-07-03
  • 打赏
  • 举报
回复
请xxxbird到如下贴子,我给你加分
http://www.csdn.net/expert/topic/175/175848.shtm
http://www.csdn.net/expert/topic/179/179040.shtm
xxxbird 2001-07-03
  • 打赏
  • 举报
回复

不知道了,这要问 Perl Builder 的设计者了,问问他们为什么做这个该死的规定。呵呵。
milson 2001-07-03
  • 打赏
  • 举报
回复
那么我指明路径和不指明路径有什么区别呢?
1112222 2001-07-03
  • 打赏
  • 举报
回复
编辑时候用ultra edit不好么?
调试直接用perlAPI和windows的web server
Againstwind 2001-07-02
  • 打赏
  • 举报
回复
关注!!!

各位有兴趣的话可以看看这篇贴子:
http://www.csdn.net/expert/topic/173/173637.shtm
xxxbird 2001-07-02
  • 打赏
  • 举报
回复

没有打开的文件需要用require指明路径,真搞不懂为什么啦。

xxxbird 2001-07-02
  • 打赏
  • 举报
回复

当调试的文件不在同一目录之下时,不需要在require中指明路径。直接将所需要调试的文件在Perl Builder中打开即可。这样就可以设置断点等进行调试。
milson 2001-07-02
  • 打赏
  • 举报
回复
刚才我试了一下,终于找到原因了
我要调试 ok.pl 在主程序里有着样的语句

require "$path/ok.pl";

我改成

require "ok.pl"

就可以调试了。

TNND,到底上一种形式的怎么调试啊?
milson 2001-07-02
  • 打赏
  • 举报
回复
谢谢!我刚才写了一个简单的工程,有两个文件hello.pl和test.pl。其中
hello.pl是主运行文件。内容如下:
// hello.pl
===================================
#!e:/perl/bin/perl

require "c:/test.pl";

&hello();

//test.pl
=================================
sub hello(){
print "Hello, world!\n"
}
1;

断点设到 print "Hello, world!\n"
如果这两个文件在同一个目录下,可以断到那行(修改require "test.pl")
如果这两个文件不在同一个目录下,假设test.pl在c:\
就不可以断到那行(修改require "c:/test.pl")

怎么回事啊?

xxxbird 2001-07-02
  • 打赏
  • 举报
回复

呵呵,公司里面的东西就算了吧。

不过调试多文件的时候有这样几个关键的地方:
(1) 主程序要放在Main Script 里面。
(2) 将要调试的所有文件都在Perl Builder 里面都打开。
milson 2001-07-02
  • 打赏
  • 举报
回复
To:xxxbird

恕我直言,这是公司的东西,而且现在用着,并且是赚钱的。
我不能给你(你能保证不出买我吗,那我就给你),可是还
是希望你能帮我。我请你吃饭。呵呵。
xxxbird 2001-07-02
  • 打赏
  • 举报
回复
呵呵,如果你愿意,将你的Project给我mail一个吧。我们一起研究研究。xxxbird@telekbird.com.cn
某鸟 2001-07-02
  • 打赏
  • 举报
回复
我记得perl由自己的调试器呀!!
什么?perl builder?

5555..
我的硬盘满了,什么都不能装了!!
5555555~~~.

我不能帮你了。
milson 2001-07-02
  • 打赏
  • 举报
回复
我按照楼上的作了啊,可是不行啊。
xxxbird 2001-07-02
  • 打赏
  • 举报
回复
(1) Perl Builder maintains a project file for every main script you work with. The project file has the same name as the script, but a ".pbp" extension. The project file keeps track of various settings associated with your script. You can think of the main script as playing a similar to role "makefile, " "workspace," or "project" in other development tools.
(2) You must open the file in the IDE before running your script. If a module or library is not open in the IDE, Perl Builder will step over it when debugging.
加载更多回复(5)

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧