Devel::LineTrace - Apply traces to individual lines.
perl -d:LineTrace myscript.pl [args ...]
This is a class that enables assigning Perl code callbacks to certain lines in the original code without modifying it.
To do so prepare a file with the following syntax:
[source_filename]:[line] [CODE] [CODE] [CODE] [source_filename]:[line] [CODE] [CODE] [CODE]
Which will assign the [CODE] blocks to the filename and line combinations. The [CODE] sections are indented from the main blocks. To temporarily cancel a callback put a pound-sign (#) right at the start of the line (without whitespace beforehand).
The location of the file should be specified by the PERL5DB_LT environment variable (or else it defaults to perl-line-traces.txt.)
perl-line-traces.txt
Then invoke the perl interpreter like this:
perl -d:LineTrace myprogram.pl
Devel::Trace, Debug::Trace
Shlomi Fish <shlomif@vipe.technion.ac.il>
To install DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB
CPAN shell
perl -MCPAN -e shell install DB
For more information on module installation, please visit the detailed CPAN module installation guide.