new_perl
new_perl

Reputation: 7735

How do you carry out remote debug when running perl as CGI together with Apache?

Seems most are using the traditional way of print for debugging purpose, is there anyone that uses remote debug for perl in linux?

Upvotes: 3

Views: 1702

Answers (2)

ysth
ysth

Reputation: 98398

There are reasonably straightforward directions here: http://search.cpan.org/dist/Enbugger/lib/Enbugger.pod#From_gdb

Though that presupposes you have a long-running perl process (mod_perl, fastcgi, etc) that wasn't expecting to be run under the debugger. If you are just using vanilla CGI, you can configure your webserver to run perl -d and set the debugger to remote debugging via its TTY or RemotePort options. Or go ahead and use Enbugger in your actual perl code as in the directions above (again, setting TTY or RemotePort).

Upvotes: 1

hpavc
hpavc

Reputation: 1335

What sort of debugging? An actual perl debugger or using warn() with tail -f /var/log/apache/error.log?

In the end i would suggest swicting to Log::Log4perl. Unless you need an actual step by step debugger.

You you need an actual debugger, you likely won't want to use Apache in the mix. You can run your cgi from the command line and pass arguments CGI.pm.

Upvotes: 0

Related Questions