1

Possible Duplicate:
How can I make Perl and Python print each line of the program being executed?

I'm looking for an equivalent of sh -x for Perl and Python.

Community
  • 1
  • 1
Mandar Pande
  • 12,250
  • 16
  • 45
  • 72
  • 1
    See [this][1] previous question [1]: http://stackoverflow.com/questions/2872089/how-can-i-make-perl-and-python-print-each-line-of-the-program-being-executed – Rich Parker Jan 12 '12 at 15:49
  • 1
    http://stackoverflow.com/questions/2872089/how-can-i-make-perl-and-python-print-each-line-of-the-program-being-executed Asked previously – Rich Parker Jan 12 '12 at 15:52

2 Answers2

7

(Excerpted from Programming Perl’s chapter on the debugger.)

If your .perldb file contains:

parse_options("NonStop=1 LineInfo=tperl.out AutoTrace");

then your program will run without human intervention, putting trace information into the file tperl.out. (If you interrupt it, you’d better reset LineInfo to /dev/tty if you expect to see anything.)

tchrist
  • 78,834
  • 30
  • 123
  • 180
6

Install Devel::Trace and perl -d:Trace.

hobbs
  • 223,387
  • 19
  • 210
  • 288