... a way around the problem ...
...
use lib "path_to_perl5" if $OS == 'MSWin32'

Others have correctly commented that the problem described in the OP is much more basic than conditional compilation (update: and seems to be essentially a system configuration problem). In addition to | Be that as it may, beyond the comparison operator problem pointed out by Tux, a use statement is executed at compile-time, but a
    if (condition) { ... }
or
    ... ifcondition;
statement executes at run-time. So the effect of

c:\@Work\Perl\monks>perl -wMstrict -le "if ('night' eq 'day') { use constant FOO => 42; } ;; print FOO; " 42
is not what you expect.

Consider the if pragma for use in cases like this — but not in this particular case!

c:\@Work\Perl\monks>perl -wMstrict -le "use if 'night' eq 'day', constant => FOO => 42; ;; print FOO; " Name "main::FOO" used only once: possible typo at -e line 1. print() on unopened filehandle FOO at -e line 1.

Update: Made some changes in the first paragraph to try to clarify the intent and focus of this reply.


Give a man a fish:  <%-{-{-{-<


In reply to Re^2: Strawberry, CPAN and PERL5 (updated) by AnomalousMonk
in thread Strawberry, CPAN and PERL5 by cristofayre

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.