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

Hi everyone!

I am new to the PerlMonks community, but I have found many helpful posts in the past when I have worked with Perl. However, I am at a new position and need to maintain/modify some existing scripts for my team but I am running into some problems finding a way to debug Perl scripts with a GUI (my best way to write/test code especially if someone else wrote it).

Anyways, I installed Eclipse with the Epic perl plugin and attempted to debug/run one of the scripts, but I got an error message (Can't locate Expect.pm in @INC (you may need to install the Expect module)). I have never used Expect and after a quick google I realized that Expect.pm module does not play well with windows and even it says that it won't work at all! I also installed ActivePerl which seems like a mistake also haha.

My question is this: What is the best free GUI IDE that I can debug Perl scripts (with Expect) easily/without too much further setup on Windows? I used to do my perl development in Unix enviro so I've seen some suggestions on using Cygwin, but I still don't know how I would set up my Perl IDE to debug while using Cygwin.

Any other questions/clarification you need please ask! I appreciate it very much.

Thanks

Replies are listed 'Best First'.
Re: Expect.pm debugging in Windows
by VinsWorldcom (Prior) on Apr 29, 2019 at 19:03 UTC

    You can try to setup Notepad++ Integrated Perl Debugging, but not being familiar with Windows it may be more trouble than it's worth. LanX above mentioned Devel::ptkdb and I use that with Notepad++ 64-bit since the dbgp plugin for 32-bit isn't available on 64-bit Notepad++.

    I also prefer Strawberry Perl as a longtime Windows user FWIW.

Re: Expect.pm debugging in Windows
by LanX (Saint) on Apr 29, 2019 at 17:21 UTC
    There is a Tk-gui for the debugger.

    Never used it on win, never had to deal with expect.

    See Devel::Ptkdb

    The only free IDE I know with debugger integration is Emacs, but I doubt that's what you are looking for.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Thanks so much for your reply! Yeah I have never used Perl in Windows (previously in a unix VM) or the Expect package. I will keep looking out online and see if I find anything - otherwise it might just be trial and error.

      My previous position I was actually doing test case development in Perl and this time around I am maintaining some already existing scripts so it will just be a bit of an adjustment getting to the point I'd like to be with a debugger and being able to execute the script so I can see output at each step of the code.

      I appreciate the timely response!

        I suppose you already tried a normal debugger run on the console and it fails because expect blocks STDIN and STDOUT.

        Ptkdb is your best try then, all IDE use the same approach to communicate to the debugger via sockets.

        If Ptkdb fails, all will fail.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Re: Expect.pm debugging in Windows
by swl (Prior) on Apr 30, 2019 at 04:59 UTC

    Is the Expect module required by Eclipse? Or is it a component of the GUI app you are debugging?

    If the latter then Expect won't install on non-POSIX systems anyway due to IO::Tty (see cpanm log below), so you would need to be able to install the GUI using (cygwin|msys2|bash for windows).

    If the former then you should be able to run your GUI code through a non-GUI debugger. The GUI IDEs just provide a nicer interface for stepping, setting breakpoints and so forth.

    Another option is to get a trial license for a commercial IDE. Maybe the trial will last long enough for you to solve the issue.

    -----

    cpanm log:

    cpanm --verbose IO::Tty cpanm (App::cpanminus) 1.7044 on perl 5.028000 built for MSWin32-x64-m +ulti-thread Work directory is C:\BERRYB~1\528~1.0_6\data/.cpanm/work/1556599810.22 +408 You have make C:\berrybrew\5.28.0_64_PDL\c\bin\gmake.exe You have LWP 6.34 Falling back to Archive::Tar 2.30 Searching IO::Tty () on cpanmetadb ... --> Working on IO::Tty Fetching http://www.cpan.org/authors/id/T/TO/TODDR/IO-Tty-1.12.tar.gz +... OK Unpacking IO-Tty-1.12.tar.gz Entering IO-Tty-1.12 Checking configure dependencies from META.json Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34) Running Makefile.PL Configuring IO-Tty-1.12 ... This module requires a POSIX compliant sys +tem to work. Try cygwin if you need this module on windows OS unsupported at Makefile.PL line 6. N/A ! Configure failed for IO-Tty-1.12. See C:\BERRYB~1\528~1.0_6\data\.cp +anm\work\1556599810.22408\build.log for details.

      It's honestly a pretty simple script (not necessarily a GUI script), I am just most familiar using Eclipse with the Epic perl plugin to debug (and like you said step through code, set breakpoints, etc)

      The expect module is just required by the perl script I am debugging (which I haven't encountered/used in my previous Perl development work). I will try the Cygwin/Strawberry Perl method and see if that helps as far as getting Expect to work on windows. Otherwise I will return to this thread and try some of the other suggestions or just use the non-GUI debugger method! I really do appreciate everyone's replies.

      I was just trying to see if there was a simple, straightforward approach that someone else has found with getting Perl + Eclipse to work on Windows

        What you are describing is very obscure in many dimensions

        Windows   X   Expect.pm   X   Debugger   X   EPIC/Eclipse

        My guess (???) is your real problem is remote debugging . °

        Like already said does the perl-debugger allow bidirectional communication via sockets.

        Like this you can run your script with Expect.pm on a Linux machine, even in a VM, and debug it from Windows.

        I'd be very surprised if EPIC didn't allow that.

        If that is not the answer you are seeking for, please try to split your general question into more specific parts

        i.e. tell us what's wrong with

        • Expect.pm
        • Windows
        • Perl Debugger
        • Eclipse / EPIC

        I'm afraid, there is no IDE which will help you overcome conceptional problems.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        update

        °) Another guess is that you just need to install Expect.pm inside cygwin's Perl installation. This has nothing to do with debugger or IDE.

Re: Expect.pm debugging in Windows
by karlgoethebier (Abbot) on Apr 29, 2019 at 19:10 UTC
    “...the best free GUI IDE that I can debug Perl scripts...„

    undef. Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      I saw that too - did they take down that page?