in reply to Re^5: STDERR in Test Results
in thread STDERR in Test Results

I came across this very interesting thread which reminded me why I didn't use warn - I don't want line numbers in the warnings from the module!

using warn instead or print STDERR?

The module does have the option to suppress or override warnings. I could use that but wanted to include the error situations in the tests.

Replies are listed 'Best First'.
Re^7: STDERR in Test Results
by hippo (Archbishop) on Jun 19, 2023 at 16:30 UTC
    I don't want line numbers in the warnings from the module

    All you need to do is append a newline:

    #!/usr/bin/env perl use strict; use warnings; warn "foo"; warn "bar\n";
    $ perl warns.pl foo at warns.pl line 5. bar $

    🦛

      When debugging, I prefer it the other way around - I append "\n\t", which gives me the line number on a line of its own, and neatly indented.