develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #118185] perl debugger doesn't evaluate user input when it should

Thread Previous | Thread Next
Linda Walsh via RT
May 26, 2013 23:41
[perl #118185] perl debugger doesn't evaluate user input when it should
Message ID:
On Sun May 26 12:43:07 2013, wrote:
> > It already exists: 'p' -- not 'P'.
> The output of p %hash is far from ideal, but x \%hash works well.
my %a=(1=>2, 3=>4, 5=>6);
  DB<5> x %a
0  1
1  2
2  3
3  4
4  5
5  6
  DB<6> use P
  DB<7> P "%s", \%a;0 
{1=>2, 3=>4, 5=>6}

For simple structures, I find P to be more clear.  For complex ones,
Data::Dumper is better.  The above is with my patch applied, FWIW....

> That's the point: at the debugger prompt something which isn't a
> debugger command is interpreted as Perl. So P there shouldn't have
> crashed, but run the P defined the program.
Crashing the debugger is generally bad even, regardless of P being
called (or not).

> > You didn't supply the program you were trying to debug, so I tried
> > this:
    See above.. I -- it duplicates the problem.  I thought it was
too trivial to include.  

> That run doesn't invoke P at all from the debugger prompt. If I do
> (without any arguments, just P) then I get the reported error message.
> So this does seem to be specifically a problem with functions called
> P.
   I went and checked -- the other letters that are checked for
are present -- so yeah, it appears to be specific to 1 letter (I seem to
have a knack for running into odd cases...)..

The patch is pretty simple, at least...

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About