20.4. Unattended Execution
If your init file contains:
then your program will run without human intervention, putting trace information into the file db.out. (If you interrupt it, you'd better reset LineInfo to /dev/tty if you expect to see anything.)parse_options("NonStop=1 LineInfo=tperl.out AutoTrace");
The following options can be specified only at startup. To set them in your init file, call parse_options("OPT=VAL").
Options can sometimes be uniquely abbreviated by the first letter, but we recommend that you always spell them out in full, for legibility and future compatibility.
Here's an example of using the PERLDB_OPTS environment variable to set options automatically. It runs your program noninteractively, printing information on each entry into a subroutine and for each line executed. Output from the debugger's trace are placed into the tperl.out file. This lets your program still use its regular standard input and output, without the trace information getting in the way.
If you interrupt the program, you'll need to quickly reset to O LineInfo=/dev/tty or whatever makes sense on your platform. Otherwise, you won't see the debugger's prompting.$ PERLDB_OPTS="NonStop frame=1 AutoTrace LineInfo=tperl.out" perl -d myprog
Copyright © 2002 O'Reilly & Associates. All rights reserved.