Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

CLI in debug?

by regnad42 (Initiate)
on Nov 07, 2018 at 13:56 UTC ( #1225378=perlquestion: print w/replies, xml ) Need Help??
regnad42 has asked for the wisdom of the Perl Monks concerning the following question:

I would like to know how to use the command line in PERL debug. I am using a 'Mintty' terminal window under 'Cygwin' and typically attempting to debug a script I have edited in VIM or somesuch. I then execute "perl -d". I do not ming retyping the small commands like

X variable

the problem is when I type a longer string, and make a small error, omission of a comma, or quote and want to hit up arrow then edir and fix it to attempt to get the correct result. What kind of 'CLI' does the debugger have to correct a previous line? Does one need to copy/paste or os there something more clever?

Replies are listed 'Best First'.
Re: CLI in debug?
by jimpudar (Pilgrim) on Nov 07, 2018 at 14:32 UTC

    Hi regnad42,

    Please check out perldebug. You probably need to install something like  Term::ReadLine::Perl from CPAN.



    πάντων χρημάτων μέτρον έστιν άνθρωπος.

Re: CLI in debug?
by garryq (Initiate) on Nov 08, 2018 at 08:23 UTC

    You can also save your history for next time if you make a ~/.perldb file and put something like this in it:



Re: CLI in debug?
by happy.barney (Friar) on Nov 11, 2018 at 08:27 UTC
    Not exactly answer to your question, just mentioning interesting module I learned from one lightning talk from Glasgow: Devel::PDB

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1225378]
Approved by stevieb
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2019-01-22 20:35 GMT
Find Nodes?
    Voting Booth?
    After Perl5, I'm mostly interested in:

    Results (390 votes). Check out past polls.