... 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
is not what you expect.c:\@Work\Perl\monks>perl -wMstrict -le "if ('night' eq 'day') { use constant FOO => 42; } ;; print FOO; " 42
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |