Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

CLI in debug?

by regnad42 (Initiate)
on Nov 07, 2018 at 18: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 codefile.pl". 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 (Monk) on Nov 07, 2018 at 19:32 UTC

    Hi regnad42,

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

    Best,

    Jim

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

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

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

    &parse_options("HistFile=$ENV{HOME}/.perldb.hist");

    Garryq

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2018-11-19 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (209 votes). Check out past polls.

    Notices?