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
From:
Linda Walsh via RT
Date:
May 26, 2013 23:41
Subject:
[perl #118185] perl debugger doesn't evaluate user input when it should
Message ID:
rt-3.6.HEAD-2650-1369611696-1245.118185-15-0@perl.org
On Sun May 26 12:43:07 2013, smylers@stripey.com 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
https://rt.perl.org:443/rt3/Ticket/Display.html?id=118185

Thread Previous | 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