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

Hi monks,

I have technical question:
I'm using ActivePerl on Win.
I'd like to insert a breakpoint in subroutine of a module (Filter-Simple)that located in the perl \ lib directory,
How do I insert such a breakpoint ?

When i'm trying "b Filter::Simple::gen_filter_import" it says "not found".
Note that the module Filter-Simple exists under lib directory.

Thanks,
Mosh

  • Comment on Insert breakpoint when debugging in AS Perl

Replies are listed 'Best First'.
Re: Insert breakpoint when debugging in AS Perl
by grinder (Bishop) on Jun 29, 2005 at 16:51 UTC

    Unless Filter::Simple is doing something tricky (haw haw haw) you should be able to say:

    f Filter/Simple.pm

    ... to switch to that file first, and from there you should be able to set the desired breakpoint.

    - another intruder with the mooring in the heart of the Perl

      Thanks,
      You're right, from some reason the module wasn't loaded, so I couldn't have insert a breakpoint, but what bothers me is that the program DO USE THIS MODULE !!

      What could be the reason that from one hand the program uses a module but on the othyer hand I can't see it was loaded ?
      Maybe somehow it was related to eval command ?

      Mosh.

Re: Insert breakpoint when debugging in AS Perl
by cmeyer (Pilgrim) on Jun 29, 2005 at 17:42 UTC
    Another option is to add the line $DB::single = 1; to the spot in the code that you'd like to force a break point. This tells the debugger to go into single step mode, effectively forcing a break point.

    -Colin.

    WHITEPAGES.COM | INC

      Didn't work !

      "Loading DB routines from perl5db.pl version 1.25 Editor support available." And then:
      "Scalar found where operator expected at C:\work\...module.pm line 111, near "$self""

        It seems that the fashion in which you inserted that statement caused a syntax error in the module. If you were to post an excerpt of the code, then it should be easy to tell. Perhaps you forgot the semicolon at the end of the assignment to $DB::single?

        -Colin.

        WHITEPAGES.COM | INC