0

I'm running ActivePerl 5.24 build 2401 x64. Previously, when I was running this build and version in Windows 7, my scripts, when encountering a fatal error, would indicate the line and reason (e.g. "Line too long in file, line 11") in the command prompt from which I was running it. This was great for me to figure out what was wrong and to debug the file.

I've recently migrated to a Windows 10 system. But now, whenever encountering an error in a script, all that happens is a window pops up saying "Perl Command Line Interpreter has stopped working". There is no additional information, and it's a pain in the butt because I have no idea where the script errored and crashed.

To be clear, Perl is installed correctly on the Windows 10 system. When I corrected the script and/or data file, everything ran swimmingly. It's only when there's an error that it displays this message, and it's useless at helping me figure out what's wrong.

I've taken to reconnecting my old system and running any scripts from there, because otherwise it's nearly impossible to figure out what's going on.

Any pointers? Any way I can have the error messages print in Windows 10 in the command prompt rather than popping up a useless message? Or is there another debugging setup that I can use? I tried using perl -d but the debugger is a little too much for my level right now.

For the record, I tried using the latest StrawberryPerl 5.24 build and ran into the exact same problem.

H1Nerd1
  • 1
  • 1
  • 1
  • @Borodin The output for `perl -E "say for @INC"` is: `C:/Program Files/Perl64/site/lib C:/Program Files/Perl64/lib .` When I enter `set PERLLIB` and `set PERL5LIB`, it indicates that there is no environment variable set. – H1Nerd1 Jan 22 '17 at 06:57
  • I ended up using a `PRINT`/`EXIT` combination instead of a `DIE` command, and it seems to have solved the problem. I don't think I know enough about the mechanics of `EXIT` vs. `DIE`, but it seems to be working, so moving on with my life. Thanks for the help! – H1Nerd1 Jan 23 '17 at 05:27

1 Answers1

0

The problem is that perl is dying, and the error condition is never reached

It's hard to be certain, but I would guess that you're picking up an old, faulty installation of perl instead of the one you think you are. That would explain why installing Strawberry Perl shows no change

Try entering

where perl

and see if there are multiple entries in the list. The entry at the top is the one that will be run in response to a perl command

Locate the perl.exe file that you want to run, and specify it explicitly on the command line, like this

C:\path\to\perl.exe

(obviously, giving the correct path)

Also check the values of PERLLIB and PERL5LIB to make sure perl isn't picking up modules built from a different version

Borodin
  • 126,100
  • 9
  • 70
  • 144
  • Thanks for this. There's only one entry on the list: C:\Program Files\Perl64\bin\perl.exe (which is where it's supposed to be). How do I check `PERLLIB` and `PERL5LIB`? Sorry, newb question. – H1Nerd1 Jan 20 '17 at 06:47
  • Enter `set PERLLIB` etc. – Borodin Jan 20 '17 at 13:21
  • Also show the output for `perl -E "say for @INC"`. It is probably best if you add information to your question rather than putting it in comments. – Borodin Jan 20 '17 at 13:23