Hello,

I've a Problem with my own CPAN-Module. One of the CPAN-Tests failed (http://www.nntp.perl.org/group/perl.cpan.testers/2007/05/msg495843.html)

The test which this error causes is line 51:
45 my $w = ''; 46 is(close(STDERR), 1, 'close STDERR'); 47 is(open(STDERR, ">", \$w), 1, 'reopen STDERR'); 48 49 50 is($test->init( abc => 1), 0, 'init with unknown parameters'); 51 is(length($w) > 0, 1, 'warnings after failed init');
The $test->init() allways warns (via Carp::carp()) so it can't be that there is no warning. I think, it's the reconnect of STDERR to catch all warnings into the lexical variable $w.

Is there a known error with this behavior in perl 5.6? Or is there an error in my catch-STDERR-code? All other CPAN-tests are passed, so I think that the code is correct.

Any wisdoms about it?

__END__
tobiwan

In reply to Catch STDERR in variables via open() failed? by Tobiwan

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.