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

Hi, I tried using Epic and installing the Padwalker but that didnt work. Kept giving me a lot of errors. Padre seems mainly for Strawberry Perl and I am using Activestate. I want to see how the code executes line by line, when values are assigned to variables and how the shift/unshift pop/push work. Basically I want to understand how each and every line of code executes. I can do that by inserting a print statement, but I really am curious to see if there is a good free Perl debugger available. Cant seem to find any. Please help.
  • Comment on Looking for a free Perl debugger. Padre/Epic doesnt seem to work.

Replies are listed 'Best First'.
Re: Looking for a free Perl debugger. Padre/Epic doesnt seem to work.
by choroba (Cardinal) on Dec 10, 2011 at 12:42 UTC
    Is perl -d too old school for you?
      Hi, I didnt know perl -d option was there. Can you point me to a guide where it says how to go about using it?
Re: Looking for a free Perl debugger. Padre/Epic doesnt seem to work.
by moritz (Cardinal) on Dec 10, 2011 at 13:10 UTC
Re: Looking for a free Perl debugger. Padre/Epic doesnt seem to work.
by keszler (Priest) on Dec 10, 2011 at 13:03 UTC

    I've used Devel::ptkdb. It hasn't been updated since 26 Apr 2004, but tried just now it runs with Perl 5.12 on XP. Activestate may not have a ppm for it, but since it's just a single .pm file all that's needed is to put it in your C:\Perl\site\lib\Devel directory.

    ...assuming that Tk is already installed...

      Hi, I dont have TK installed, and couldnt find it in PPM. Using -d option as of now, but thank you for taking time to reply.

        It appears that the Bribes repository has Tk compiled for 64-bit Perl 5.14. Try

        ppm install http://www.bribes.org/perl/ppm/Tk.ppd

Re: Looking for a free Perl debugger. Padre/Epic doesnt seem to work.
by cormanaz (Deacon) on Dec 10, 2011 at 16:52 UTC
    Well it's not free, but it's free to try: Activestate Komodo IDE. It's got a GUI based debugger that shows you current values of local and special variables in a tabbed format. More convenient than the built in Perl debugger, IMO.

      I can agree on that. Tried various other things in the past few years. Always went back to the ActiveState products.

      Without trying to pitch a product here: At least from my point of view, the full ActivePerl Pro Studio is well worth the price. Having a fully grown IDE *and* Access to the Safari bookshelf saved me quite a lot of frustration. It's certainly not perfect, but it gets the job done.

      What i certainly like most is the standard way in which debugging is handled. It's just like i'm used to from other IDEs, just click left of the code line where you want a breakpoint, run and the program stops there - and then you can look at (and modify) all variables.

      If it's worth the price for you certainly depends. Do you only do Perl programming for a hobby a few hours a week or is it your job?

      For me, i'm doing like 30 hours a week programming in my 40 hour a week job. Plus whatever i do in my spare time. So yeah, paying for a product that helps me isn't really a problem.

      Don't use '#ff0000':
      use Acme::AutoColor; my $redcolor = RED();
      All colors subject to change without notice.
        Hi, I am not a developer by profession. Just trying to learn Perl. Since I am not writing really big and complex stuff like how you guys write, getting a full version of Komodo would be kind of an overkill for me. But yeah, I am using Komodo IDE and finding it much better. Was using Notepad earlier... Thanks
Re: Looking for a free Perl debugger. Padre/Epic doesnt seem to work.
by umasuresh (Hermit) on Dec 10, 2011 at 12:53 UTC
      Hi, It fails. C:\perl\practice>ppm install Tk ppm install failed: Can't find any package that provides Tk C:\perl\practice>

        Activestate Tk packages Activestate haven't (yet?) created a working Tk package for Perl 5.14 on Windows. They do have packages for 5.12, or 5.14 on Linux...

Re: Looking for a free Perl debugger. Padre/Epic doesnt seem to work.
by TJPride (Pilgrim) on Dec 10, 2011 at 14:06 UTC
    If I'm not sure how something works, I just write and run a tiny program to test that particular situation. With proper sectioning into subs, and liberal use of print and Data::Dumper, it's not too hard to verify if something is working as planned. For the most part, anyway - logic errors can be difficult to find, as well as the occasional little thing like using == instead of eq or = instead of ==. Depending on your input, a debugger may not identify that sort of problem.