DB::LineCache - package to read and cache lines of a Perl program.
The LineCache package allows one to get any line from any file, caching lines of the file on first access to the file. Although the file may be any file, the common use is when the file is a Perl script since parsing of the file is done to figure out where the statement boundaries are.
The routines here may be is useful when a small random sets of lines are read from a single file, in particular in a debugger to show source lines.
use 'DB::LineCache' lines = DB::LineCache::getlines('/tmp/myperl.pl') # The following lines have same effect as the above. $: << '/tmp' Dir.chdir('/tmp') {lines = DB::LineCache::getlines('myperl.pl') line = DB::LineCache::getline('/tmp/myperl.pl', 6) # Note lines[6] == line (if /tmp/myperl.pl has 6 lines) DB::LineCache::clear_file_cache DB::LineCache::update_cache # Check for modifications of all cached files.
To install Devel::Trepan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Trepan
CPAN shell
perl -MCPAN -e shell install Devel::Trepan
For more information on module installation, please visit the detailed CPAN module installation guide.