Peter Scott <[EMAIL PROTECTED]> writes: > Eh? The n and s commands do exactly that. See also the r command. > > Sounded like the original poster wanted tracing. The t command in the > debugger does that. > > Tracing isn't generally as useful for a Perl script as for a shell > script because a shell script typically executes far fewer statements > than the average Perl script. So the output can be unreasonably > verbose.
What OP (me) wanted in this case is to run a perl script that conducts a backup of certain files, checks the age of other accumulated backups, deletes ones older than $X. And does some other checks and mails a report. I wanted to get the report as well as the commands as they execute while the script is running. The perl code prints to FILEHANDLES So I can insert a second print to tty at each and a print to echo the commands: (NOTE:Exaggerated example code, not a working script) open(FILEHANDLE,">>some.file"); open(PROC."some tar process"); print "Starting \"some tar process\"\n"; while(<PROC>){ print FILEHANDLE $_; push @A,$_; print $_; } [...] close(PROC); open(PROC2,"|mail -s "backup report" reader"); print PROC2 @A; close(PROC2); close(FILEHANDLE); etc etc .. That is, shadow every process like the first one above for debug purposes. in addition to printing to whatever filehandles. (Only the first part above is shadowed for an example) All quite a pain in the butt. I wanted a better way that mimics sh -x. Can you show what the output of the `t' flag or the others you mentioned would be like on the above simple code? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]