Fellow Monks, when I released Games::Literati 0.032, I discovered the hard way (thanks, CPAN Testers) that in-memory files are not compatible with Perl 5.6. The module itself doesn't use in-memory files, but part of my test suite did. So I reworked the test suite to not use in-memory files. I then found Perl::MinimumVersion 1.38, and ran perlver on my module and test files, and all claimed to be Perl 5.6.0 compatible. However, when I released Games::Literati 0.040, I was surprised to see CPAN Testers flag me for failure when tested under Perl 5.6.2. :-(

tl;dr summary

  1. What Perl version introduced open() using '<&'? I know that by 5.8.5, it works, and apparently it doesn't in 5.6.2.
  2. Should I consider it a bug in Perl::MinimumVersion 1.38 that perlver claimed my test suite was compatible with 5.6.0?
  3. Should I just skip the portions of my test suite that require the '<&'? Or should I try to find an alternate?
  4. Easy way to get 5.6.0 on Windows? (Alternately, pre-made virtual machine with 5.6.0?)

tl;dr details

CPAN Testers error message: Unknown open() mode '<&' at t/03_input_processing.t line 46.

Specifically, line 46 refers to:

open STDIN, '<&', $fh or do { warn "set STDIN = \$fh=\\$fh: $!"; return undef; };

(I find it strange that it flagged on line 46, because line 42 has similar code

open my $oldin, "<&STDIN" or do { warn "dup STDIN to \$fh=\\$fh: $!"; return undef; };
...which seems to be using the same feature. So why did it flag on 46, but not 42?)

(full source: https://metacpan.org/source/PETERCJ/Games-Literati-0.04/t/03_input_processing.t)

perlver output:

C:>perlver t\03_input_processing.t ------------------------------------------------------ | file | explicit | syntax | external | | ------------------------------------------------------ | | t\03_input_processing.t | v5.6.0 | v5.6.0 | n/a | | ------------------------------------------------------ | | Minimum explicit version : v5.6.0 | | Minimum syntax version : v5.6.0 | | Minimum version of perl : v5.6.0 | ------------------------------------------------------

Before I send a bug report to Perl::MinimumVersion for not catching that apparent incompatibility with 5.6.2, I did some more searching, and found open() with more than two arguments. Reading that, it seems to indicate that 5.6.1 was the first to include 3-argument open(). Did I read that correctly? If so, am I correct in concluding that's a separate bug in perlver()? ie, that it should have flagged 3-argument open as requiring 5.6.1?

I couldn't find the perldelta that indicated when '<&' open mode was introduced. I tried looking specifically for an archive of the Perl 5.6 perldocs, but my google-foo isn't that good, apparently. And I don't have access to Perl 5.6.* to look at the docs directly. (I'm mostly on Windows, and Strawberry Perl doesn't go back that far, and ActivePerl only allows older versions for Business or Enterprise Editions. I have access to a machine at $work that has 5.8.5, which is how I know it works by then. But while doing a quick run of a perl script during my coffee break is forgivable, installing a whole old version of perl on that server, even if I did a local installation, would be highly frowned upon, and I enjoy my $paycheck.) So is there a Monk who knows or can easily point me to when '<&' was introduced? I'd like to have 'proof' to supply during my '<&' bug report, but cannot find it, aside from my anecdotal evidence from the CPAN Testers 5.6.2 failure.

Also, more importantly, how do I solve this problem in my test suite? For now, the redirection is only used because the function it's testing gets its input from STDIN, and for the test suite, I wanted to provide input to that function to test it :-). But the redirection isn't used in the module itself, so it's 5.6-compatible. Should I figure out a workaround for the test suite? If so, I desire recommendations from my fellow Monks as to a 5.6-compatible method of testing that function. Or should I just plan skip_all => "Cannot redirect STDIN in perl $]" if $] lt '5.008';?

(Historical note: I'm reluctant to claim that the module requires something higher than 5.6, when it's just the test suite that requires it. That seems rude, especially since the original module that I inherited apparently worked under 5.6, and nothing I've done to improve the module should change that. Why be rude to a Scrabble/Literati player from the early 2000s who doesn't feel the need to upgrade perl just to optimize points, who wants bug fixes and/or to include Words with Friends scoring now?)

Finally, is there any easy way to get a copy of 5.6.0 for Windows? Or is there a small, easy to install linux virtual machine that has 5.6.0 pre-installed?

UPDATE: fix typos

UPDATE: add <readmore>


In reply to open('<&'), Perl::MinimumVersion, and my test suite by pryrt

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.