Penguin
Diff: PerlOneLiners
EditPageHistoryDiffInfoLikePages

Differences between version 24 and previous revision of PerlOneLiners.

Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History

Newer page: version 24 Last edited on Wednesday, May 11, 2005 2:57:40 pm by CraigBox Revert
Older page: version 23 Last edited on Tuesday, November 2, 2004 5:00:51 am by AristotlePagaltzis Revert
@@ -42,8 +42,16 @@
 perl -pe 's!\\n!\n!g; s!\\t!\t!g' $file 
 </verbatim> 
  
 Note that you can use any punctuation as the separator in an <tt>s///</tt> command, and if you have backslashes or even need literal slashes in your pattern then doing this can increase clarity. 
+  
+!! sh -x a Perl script  
+  
+If you're just trying to get a printout of each line of Perl code as it executes (the way that sh -x provides for shell scripts), you can't use Perl's -D switch. Instead do this:  
+  
+<verbatim>  
+$ PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS program  
+</verbatim>  
  
 !! List all currently running processes 
  
 This is useful if you suspect that ps(1) is not reliable, whether due to a RootKit or some other cause. It prints the process ID and command line of every running process on the system (except some "special" kernel processes that lie about/don't have command lines).