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

Darndest thing ever, fellow monks. I was playing with the perl -d debugger, and it failed with an odd looking error about connecting to localhost. Of course, I assumed it was my script, but it aint. Join me below the readmore tag for hot code action.
C:\perl -v This is perl, v5.8.0 built for MSWin32-x86-multi-thread C:\>more #!perl use strict; my $var = 'Beard\n'; print $var; C:\>perl -d Unable to connect to remote host: Compilation failed in require. main::BEGIN() called at C:/Perl/lib/ line 0 eval {...} called at C:/Perl/lib/ line 0 BEGIN failed--compilation aborted.
Thanks for any input, I really dont even know where to begin (ha!) on this one. Of course the is irrelevant, but why on earth is the debugger attempting a connection?

Confused Smitz

Replies are listed 'Best First'.
Re: Debugger failing to connect to localhost
by Thelonius (Priest) on May 14, 2003 at 12:49 UTC
    Looking at the code, it seems that the only way this could happend is if you set the option RemotePort. It looks for options in a couple of places. First it looks for a file called (on windows) "perldb.ini" in the current directory, your home directory (if $ENV{HOME} is defined), or $ENV{LOGDIR} (if defined).

    It then looks for an environment variable called PERLDB_OPTS.

    Hope that helps.

Re: Debugger failing to connect to localhost
by BrowserUk (Patriarch) on May 14, 2003 at 12:57 UTC

    It looks like you have the "remoteport=localhost:nnn" set in an environment variable called PERLDB_OPTS or possible a config file (called ./.perldb or ~/.perldb) containing parse_options("remoteport=localhost:nnn").

    See perldebug and/or

    perl -de1 h O ... RemotePort Remote hostname:port for remote debugging ...

    For (a little) more information.

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
      Folks who try Active States Dev Kit end up with this error when the demo runs out because the de-installer doesn't clean this Environment Variable up. So, you will have to do it yourself. You can do it from the system properties on the environment variables tab if you are on 2K/XP.
      He! perl -del dies with the same message, and I definately dont have an env. var. like that set, I've listed all of them below.
      Thanks for the suggestions though, keep them coming :-)

      Update: In fact, I do have that Env Var set. Wake up, smitz
Re: Debugger failing to connect to localhost
by smitz (Chaplain) on May 14, 2003 at 13:40 UTC

    Thanks all! Problem solved.

Re: Debugger failing to connect to localhost
by smitz (Chaplain) on May 14, 2003 at 13:28 UTC
    My ENV:
    C:\>set ADP=LDAP://CN=Schmitz\, AlexX,OU=Workers,DC=ger,DC=corp,DC=xxxx,DC=com ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\aschmi1X\Application Data CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=ASCHMI1X-DESK ComSpec=C:\WINNT\system32\cmd.exe DJGPP=C:|djgpp\djgpp.env FTP_proxy= HOMEDRIVE=C: HOMEPATH=\ HTTP_proxy= LANG=enu LOGONSERVER=\\SWSGER001 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Os2LibPath=C:\WINNT\system32\os2\dll; Path=C:\Perl\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C: +\Oracle\Or a81\BIN;C:\Program Files\Oracle\jre\1.1.7\bin;C:\httpd\php;C:\djgpp\bi +n;C:\progr am files\resource kit; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PERLDB_OPTS=RemotePort= PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 3, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=0803 ProgramFiles=C:\Program Files PROMPT=$P$G PSTLoc=C:\Documents and Settings\mtrattlx\Local Settings\Application D +ata\Micros oft\Outlook RABUILD=AMR SMS_LOCAL_DIR=C:\WINNT SMS_LOCAL_DIR_USER=C:\WINNT SYBASE=C:\SQL10 SystemDrive=C: SystemRoot=C:\WINNT TEMP=C:\DOCUME~1\aschmi1X\LOCALS~1\Temp TMP=C:\DOCUME~1\aschmi1X\LOCALS~1\Temp USERDOMAIN=GER USERNAME=aschmi1x USERPROFILE=C:\Documents and Settings\aschmi1X windir=C:\WINNT
    And I have searched all my drives for a file called perldb.ini, and found nothing. The thing is, this isn't the first time I've used the debugger, and it always worked fine. Grrrrr