in reply to Very basic question on reading error messages

Redirect errors to a file and read them at your leisure:
perl myprogram.pl 2>errors.txt # Or on WinNT you can do just like Unix: perl myprogram.pl 2>&1 | more

Replies are listed 'Best First'.
(tye)Re: Very basic question on reading error messages
by tye (Sage) on Sep 08, 2001 at 00:27 UTC

    The first one doesn't work under Win9x either (IIRC). If you are on Win9x, the command shell is so broken that there is no way to get it to send STDERR to a file. Luckilly, you have Perl which means you have lots of ways you could do it:

    perl -e "open(STDERR,'>>errors.log'); do 'script.pl'" perl -e "open(STDERR,'>>errors.log'); exec $^X,'script.pl'"
    to give just a couple that I didn't notice already in this thread. (:

            - tye (but my friends call me "Tye")
      program -args >& out.txt works just fine if you use the 4NT shell. Nobody in his right mind who actually uses the command line would try and cope with CMD.exe or worse yet COMMAND.COM.

      —John