Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
PerlNotes
Edit
PageHistory
Diff
Info
LikePages
This page contains some notes about the [Perl] programming language. We also have a page of useful PerlOneLiners. ----- !! Trace execution in a [Perl] script Getting a trace showing each executed line of code in sequence (think <tt>sh -x</tt> but for [Perl] scripts) is not obvious. perl(1)'s <tt>-D</tt> switch itself does not provide such functionality, but you can get there like so: <verbatim> $ PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS program </verbatim> Another option is to install the [Devel::Trace | http://search.cpan.org/dist/Devel-Trace/] module and simply use it on the script using the <tt>-d:Trace</tt> argument: <verbatim> $ perl -d:Trace program </verbatim> This does not work everywhere, but is has the advantage that you can easily influence the amount of trace output from within the script. [Perl] developers will therefore probably prefer to use the module. ----- CategoryNotes
One page links to
PerlNotes
:
Perl