So, the answer is no ...

Yeah ... I was looking for a way of ensuring that whenever perl was run, then a specific module would be loaded before all other modules.
I was hoping that loading that module at the beginning of perl5opt would achieve that end, but now I see that alone is not guaranteed to work.

Actually, I was just wanting Test/Builder.pm to load Math/Ryu.pm (if Math::Ryu was installed).
The usual way to do that would be to have Builder.pm do eval{require Math::Ryu} but that causes t/Legacy/dont_overwrite_die_handler.t to fail a test (in the Test::Simple test suite) if Math::Ryu was not found.
Seems a funny thing to be causing a test to fail - but if they're testing for it, then one assumes it's important. (Shrug.)

So the next approach was to have Builder.pm check whether "Math/Ryu.pm" was in %INC ... and that's where it became important that Math::Ryu (if available) was loaded before Test::Builder.
Maybe that can be done simply enough ... but there's a few "what-ifs" to process when thinking through that.

And it's just an exercise that's not really going to lead anywhere.
Test::More can throw out some really stupid and irritating diagnostics like:
>perl -MTest::More -le "cmp_ok(0.1 ** 2, '==', 0.01, 'T1'); done_testi +ng();" not ok 1 - T1 # Failed test 'T1' # at -e line 1. # got: 0.01 # expected: 0.01 1..1 # Looks like you failed 1 test of 1.
So I've patched Test/Builder.pm to be (eg) capable of providing:
>perl -MMath::Ryu -MTest::More -le "cmp_ok(0.1 ** 2, '==', 0.01, 'T1') +; done_testing();" not ok 1 - T1 # Failed test 'T1' # at -e line 1. # got: 0.010000000000000002 # expected: 0.01 1..1 # Looks like you failed 1 test of 1.
I'll submit a PR when (if) I get the detail of involving Math::Ryu reliably sorted out.
But this irritating Test::More behaviour crops up only rarely, and no-one cares about it, anyway.

hippo, thanks for digging up the documentation.

Cheers,
Rob

In reply to Re^2: Unexpected behaviour with PERL5OPT by syphilis
in thread Unexpected behaviour with PERL5OPT by syphilis

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.