问题描述
我不熟悉Mojolicious,但是已经使用Perl一段时间了.我必须克服一些麻烦,但是我可以使交互式Perl调试器(和Komodo)与Apache的远程连接一起工作,但是我找不到关于使用hypnotoad或morbo进行交互式调试的任何东西.
I'm new to mojolicious but have been using Perl for some time. I have to jump through some hoops but I can get the interactive Perl debugger (and Komodo) working with remote connections for Apache but I can't find anything about interactive debugging with hypnotoad or morbo.
http://mojolicio.us/perldoc/Mojolicious/上的基础教程中的命令行示例Guides/Tutorial#Hello-World 可以正常运行,因为您可以使用perl -d启动它们,但是无论如何我都看不到告诉hypnotoadctl脚本将服务置于交互式调试模式ala apache.
The command line examples in the basic tutorial on http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#Hello-World work fine because you can launch them with perl -d, but I don't see anyway to tell the hypnotoadctl script to put the service in interactive debug mode ala apache.
这不可能吗?提示?尖端?指针?
Is this not possible? Hints? Tips? Pointers?
推荐答案
morbo
和hypnotoad
是perl程序,因此可以使用-d
开关启动它们.
morbo
and hypnotoad
are perl programs, so you can launch them with the -d
switch.
perl -d $(which morbo) myMojoApp.pl
在您的应用程序周围散布一堆$DB::single = 1
语句可能是最简单的,您希望在其中放置初始断点并以c
作为第一个调试器命令运行.当您运行遇到断点的请求时,您将在启动morbo
的终端中看到调试器提示.
It's probably easiest to sprinkle a bunch of $DB::single = 1
statements around you app where you want your initial breakpoints to go and run c
as the first debugger command. When you run a request that hits a breakpoint, you'll get a debugger prompt in the terminal that launched morbo
.
hypnotoad
与调试器一起使用将更加棘手,因为它会快速关闭所有标准文件句柄,多次调用fork
并成为守护程序.
hypnotoad
will be trickier to use with the debugger because it quickly closes all the standard filehandles, calls fork
several times, and becomes a daemon.
这篇关于如何使用hypnotoad或morbo调用交互式Perl调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!