develooper Front page | perl.perl5.porters | Postings from August 2012

changing Devel::Peek so it doesn't unconditionally print to STDERR

Thread Next
From:
Rocky Bernstein
Date:
August 25, 2012 19:50
Subject:
changing Devel::Peek so it doesn't unconditionally print to STDERR
Message ID:
CANCp2gYgkXj4O4H90nEZ5RE=Uf957DaeFLBkBmB7wTUaFdGCYg@mail.gmail.com
I've been writing a new debugger for perl [1] and a suggestion was provide
Devel::Peek support. [2]

The problem is that Devel::Peek writes to STDERR unconditionally and that's
not what is always desired. For example, the debugger could be attached to
from a socket -- this is typically done in debugger front ends like Padre
or Eclipse -- so output needs to go back over that socket connection. I've
tried using Capture::Tiny and basically what it does underneath, but due to
the weird nature of evaluation in a debugger, it doesn't work [3].

Independent of this use case, I think Devel::Peek should provide an
interface where it returns a string. Looking at the code though, it looks
like the simplest way to do this would be to allow an optional file handle
argument. With this one could pass an in-memory filehandle.

Thoughts?

[1] https://github.com/rocky/Perl-Devel-Trepan
[2] https://github.com/rocky/Perl-Devel-Trepan/issues/13
[3]
https://github.com/rocky/Perl-Devel-Trepan/commit/b59c7db00f6f8f64579edb1e981b78625727a97b


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About