jesuashok has asked for the wisdom of the Perl Monks concerning the following question:

fellow people,

I would like to use -D<number> option when I run perl code. but perl is not compiled with -DDEBUGGING option.

could you suggest me someway to overcome this. Or, Is it mandatory that I need to compile the perl again with -DDEBUGGING option and install it ?

  • Comment on Using -D option with perl, if perl not compiled with -D

Replies are listed 'Best First'.
Re: Using -D option with perl, if perl not compiled with -D
by chromatic (Archbishop) on Jan 25, 2007 at 05:03 UTC

    You do indeed need a Perl compiled with -DDEBUGGING, unless Devel::Peek or re cover what you want.

Re: Using -D option with perl, if perl not compiled with -D
by Zaxo (Archbishop) on Jan 25, 2007 at 05:20 UTC

    I give myself a second account on a machine (username zaxo) who maintains a private perl installation in the home directory. If ~/bin is first in $PATH, then, zaxo runs his own perl. It is always compiled with -DDEBUGGING, and is usually somewhere near the bleading edge.

    I've wished for what you want, but only when I was unprepared to deal with trouble. It's possible to fire up a script under gdb and debug at C and asm level, but that also requires that symbol tables retain names and such. That means -DDBUGGING again. Debugging perl scripts with gdb is like taking landscape photos with a microscope.

    After Compline,
    Zaxo

Re: Using -D option with perl, if perl not compiled with -D
by ysth (Canon) on Jan 25, 2007 at 05:13 UTC
    What do you want to do? You can't use -D without -DDEBUGGING, but some of the information is available other ways (-MO=Concise or use re "debug", for instance).
Re: Using -D option with perl, if perl not compiled with -D
by Tanktalus (Canon) on Jan 25, 2007 at 05:04 UTC

    Um ... what does the documentation say?

    sets debugging flags. To watch how it executes your program, use -Dtls. (This works only if debugging is compiled into your Perl.)
    I guess it is mandatory... if you want it to do something.