title: Is there any sane way to watch for a condition when debugging Perl code?
body: <p>I tried using the <code>w</code> command of <code>perl -d</code>, giving it a condition like <code>w ($root =~ /something/)</code> to stop when <code>$root</code> changes, but it has this habit of stopping even if the variable just goes out of scope. So it's useless to me. I tried adding something like <code>w (!$root || $root =~ /something/)</code> but that seems to lead to some weird behaviour like stopping randomly and going into random <code>sub</code>s. And in any case, even if this latter one worked it'll stop if the new scope contains a variable with the same name, so I'd prefer not to have to use it. </p>
  
  <p>So, is there any other way of achieving a current-scope-only watch with the Perl debugger? Or is there any other console debugger for Perl that provides this? </p>