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

Greetings,

I am experimenting with ASPN PDK, which comes with a (rather cool, as even a non IDE person like me has to admit) graphical debugger.

However I am also deeply addicted to the 'perl -e 42 -d' thingy to get a perl shell...
And I found out that that does not work any more! Any perl -d attempt fires up the graphical debugger. To my utter surprise, this also happens with an unrelated native 5.8 build on the same Win32 box.

After some digging in the docs, it turns out that setting a couple of environment variables (PERLDBOPTS and PERL%DB), with PERL5DB set to

BEGIN { require 'perl5db.pl';}
resets my beloveed CLI behavior.

But...
How does it do it? Meaning, how can the perldebug influence a perl interpreter it knows nothing about and which should not know about perldebugger?

Just curious. I tried to delve in the perl5db.pl and perldoc perldebug, but I could not spot the magic.

Cheers,
alf


You can't have everything: where would you put it?

Replies are listed 'Best First'.
Re: ASPN perldebug magic?
by robartes (Priest) on Oct 30, 2002 at 19:04 UTC
    What was the value of PERL5DB before you set it to use perl5db.pl? The two ways to influence the behaviour of the Perl debugger seem to be through the PERL5DB environment variable, as you did, or through a .perldb file in your home directory - although I'm not sure what "home directory" translates to on Win32. Did the IDE perhaps fiddle with one of these?

    CU
    Robartes-

      Greetings,

      the standard (perl) environment (no fiddling) is as follows:

      PERL5DB [unset] PERLDB_OPTS=RemotePort=127.0.0.1:2000
      this will start the IDE. After fiddling:
      PERL5DB=BEGIN {require 'perl5db.pl';} PERLDB_OPTS [unset]
      What makes (half of) the difference is PERLDB_OPTS: if it is set, the GUI starts no matter what PERL5DB is set to...

      <slaps loudly on forehead>: OK, so now I know. AS actually does two things:

      1. Hooks into the RemotePort option of perl5b.pl to direct the debugger to the GUI but also....
      2. sets a registry key (HKLM\Software\perl\PERL5DB) to its own version of perldb (perl silently honors these keys as if they were environment variables).
      3. So restoring the original behavior one has to both unset PERLDBOPTS *and* PERL5DB
      Quite tricky (perhaps too much so...).
      Thanks for pointing in me in the right direction - now the smoke has cleared and the mirrors are broken :-)
      Cheers,
      alf
      You can't have everything: where would you put it?
Re: ASPN perldebug magic?
by toiletmonster (Novice) on Oct 30, 2002 at 20:26 UTC
    k, not sure if i understand your question. i think you are saying that perl -d is not the perl debugger and you don't use it for debugging, you just use it to try code snippets? um, perl -d or the "perl shell" is the perl debugger. says so in the first paragraph of man perldebug.

    or maybe i totally misunderstood what you are asking....