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

Replies are listed 'Best First'.
Re: Printing -w output to a file
by Zaxo (Archbishop) on Nov 22, 2002 at 00:56 UTC

    What DamnDirtyApe said, but from within the script:

    local *STDERR; open STDERR, '>>', 'foo.txt' or die $!; warn $/, 'Starting ', $0, $/;

    After Compline,
    Zaxo

Re: Printing -w output to a file
by DamnDirtyApe (Curate) on Nov 22, 2002 at 00:51 UTC

    Redirect STDERR to a file.

    % perl test.pl 2> foo.txt

    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche
214970
by Samn (Monk) on Nov 22, 2002 at 01:07 UTC