Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: debug: local watch expression

by wjw (Priest)
on Dec 06, 2006 at 18:04 UTC ( [id://588145] : note . print w/replies, xml ) Need Help??

in reply to debug: local watch expression

quick and dirty... put a print statement after the setting of your $attribute variable, and set a break point after the print statement... . Will save you a lot of time I think...

$attribute = "whatever"; print "$attribute\n"; #set break here

Even better look Here about 1/3 down the page. You will see a line that states-

"For example, this will print out $foo every time line 53 is passed:"

a 53 print "DB FOUND $foo\n"

I believe that is what you want...

...the majority is always wrong, and always the last to know about it...

Replies are listed 'Best First'.
Re^2: debug: local watch expression
by InfiniteLoop (Hermit) on Dec 06, 2006 at 21:20 UTC
    Thanks wjw. I guess there is more than one way to do it :). However, it still bugs me that I can't watch, under debugger, a variable in a selected package. I have used Komodo to debug perl code and I was able to watch a selected variable, but it wouldn't break on the watched variable though.
      Yeah, I generally use Devel::ptkdb, but of course that requires that Tk be installed. I have also used ddd on Linux and Cygwin, and like that a lot. I simply refuse to pay for Komodo, and have found the Epic plugin for MyEclipse sort of wierd too... . I generally find that I end up back at the CLI debug with some variation of what I mentioned earlier. I usually just don't have the time to mess around setting up a 'convenient' debug environment when at work. :-)

      Glad you brought up that question too. Made me go back and review the perldebug docs, which pointed out a few things that I could be doing to speed things up...

      ...the majority is always wrong, and always the last to know about it...