gitarwmn has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to get a script to run in verbose mode. I would like to have my script output to a file and be able to catch all the information I can. I know I can type "perl xxx.pl > whatever.txt" from the command line and get some of the scripts output in the txt file but I would like the txt file to contain as much detailed information about what is happening when the script runs as possible. Thanks

Replies are listed 'Best First'.
Re: verbose
by borisz (Canon) on Jun 29, 2004 at 00:01 UTC
    you can run your script under the debugger.
    export PERLDB_OPTS="NonStop=1 LineInfo=db.out AutoTrace" perl -d xxx.pl > whatever.txt
    then examine the file db.out in the current directory.
    Or look at CPAN for Devel::Cover or maybe you search for Devel::DProf.
    Boris
      Thanks, that gives me something to go on.
Re: verbose
by Fletch (Bishop) on Jun 29, 2004 at 00:02 UTC

    Perhaps Devel::Trace? Other than that, your best bet is to add statements like print STDERR "## blah blah \$foo $foo\n" at interesting points. Modules such as YAML and Data::Dumper are useful if you've got complex data structures to display.