rjbs/io-tiecombine — pull request #1 by rwstauner (2012-09-26 20:26:03+00:00)
Title: Say then print to show bug with say

# tl;dr

When STDOUT is localized and tied to this class and then `say` is used newlines are incorrectly appended to successive uses of `print`.

If it's possible to fix the issue in this module (or any other module (or perl itself for that matter)) I don't know where to begin to look.

# background

I have a project with a large test suite that includes a subdirectory of tests that use App::Cmd::Tester.

I tried running the whole suite under Test::Aggregate::Nested
and found that some of output from the tested commands was getting an extra newline,

I discovered that it started happening (in the suite) after running a test that used `say`.

After diving into some of the modules I narrowed the issue down to this:

perl -MIO::TieCombine -E 'print do { my $hub = IO::TieCombine->new; my $x = $hub->scalar_ref("x"); tie local *STDOUT, $hub, "x"; say "foo\n"; print "bar\n"; $hub->slot_contents("x"); };'

which came mostly from stuff I saw in App::Cmd::Tester.

IO::TieCombine has a warning in the pod about using `say` but it specifically warns against different behavior.

I added the second test file and then realized that merely swapping the order of two lines
already in `t/basic.t` is sufficient to test it.

I don't know if you want these tests but you're welcome to them :-)
Let me know if there's something else I can do.