Re: are you running under the perl debugger ?

Marc Espie <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
On Thu, Jun 25, 2026 at 09:55:54AM -0700, Andrew Hewus Fresh wrote:
> On Wed, Jun 24, 2026 at 01:50:39AM +0200, Marc Espie wrote:
> > On Tue, Jun 23, 2026 at 02:22:35PM -0700, Andrew Hewus Fresh wrote:
> > > On Tue, Jun 23, 2026 at 06:08:01PM +0200, Marc Espie wrote:
> > > > The following snippet:
> > > > 
> > > > can be used to determine if I am running under perl -d.
> > > > 
> > > > I'm wondering if there's something cleaner.
> > > 
> > > I asked at work and millert@'s neighbor Tom says he uses:
> > > 
> > >     sub am_running_perldb() {
> > >         no warnings "once";
> > >         return keys(%DB::sub) > 0;
> > >     }
> > > 
> > 
> > Nice... Indeed that's simpler.
> > 
> > Objections to me using some similar magic ?
> 
> None that I can think of.
> 
> 
> > Anyone having a magic way to handling eval {}; from within the debugguer ?
> 
> I asked, and Tom seemed a little surprised and (paraphrasing) said you
> should be able to (s)tep or (n)ext into eval blocks, but if that isn't
> working you could set an explicit (b)reak on the line you want to stop.
> Worst case you could add `DB::single = 1` right before in the code, but
> that is very seldom necessary.
> 
> Perhaps I misunderstood what "handling eval" means.

I think it works better than it used to...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.