Update: Problem already found in Re^4: STDERR in Test Results.


Both tests pass but I still get the output to STDERR when the process method is called. I guess I'm just looking for a way to suppress the output...

Or perhaps for a place where someone prints to STDERR or warns.

Looking at B::S::W 1.11 at CPAN, B::S::W::process() calls $self->_error() with the error message shown. And now look at that method:

sub _error { my ($self, $message) = @_; $self->{'error'} = $message; if (defined &{$self->{'error'}}) { &{$self->{'error'}}($message); } else { STDERR->print("Stripe Webhook Error: $message\n"); } }

That's why you shall use warn and die instead of printing to STDERR. sub _warning has the same problem.


Oh, by the way: eval catches errors, not warnings, so your variable would be better named $got_error instead of $got_warn.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^3: STDERR in Test Results by afoken
in thread STDERR in Test Results by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.