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

Re: [perl #118185] perl debugger doesn't evaluate user input when itshould

Thread Previous | Thread Next
From:
Smylers
Date:
May 27, 2013 06:40
Subject:
Re: [perl #118185] perl debugger doesn't evaluate user input when itshould
Message ID:
20130527063947.GE2043@stripey.com
Linda Walsh via RT writes:

> 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.

Except that what I suggested wasn't x %a, but x \%a.

The documentation of x in perldebug also recommends the backslash, and
it mentions configuration options available for controlling the
formatting -- so you can have output all on one line.

What is it that your proposed P command does that the debugger doesn't
already provide?

Smylers
-- 
Stop drug companies hiding negative research results.
Sign the AllTrials petition to get all clinical research results published.
Read more: http://www.alltrials.net/blog/the-alltrials-campaign/

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