in reply to Re: Re: How to handle Cross-platform Perl, modules, and versioning
in thread How to handle Cross-platform Perl, modules, and versioning
That won't work as-is because both BEGIN{} blocks will be executed before the if statement is even compiled.
If performance or memory is a consideration, unless you are using %Config for other things as well, you would be better off using $^O to test for the OS. It contain sthe same info as $Config{'osname'} but without the overhead of loading Config.pm.
Also, why are you putting a single scalar into an array and then unshifting the array?
This ought to come pretty close to what you are trying to do I think. (NB:untested)
BEGIN{ # UPDATE: Corrected typo pointed out my [Abigail-II] below. unshift @INC, $^O =~ m[^(?:MSWin32|solaris)$]i ? '/foo/custom/perl/lib/Custom_mods5.6.1' : '/foo/custom/perl/lib/Custom_mods5.005_03'; }
Though that is probably better coded as
(Also partially untested)
BEGIN{ use lib $^O =~ m[^(?:MSWin32|solaris)$]i ? '/foo/custom/perl/lib/Custom_mods5.6.1' : '/foo/custom/perl/lib/Custom_mods5.005_'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to handle Cross-platform Perl, modules, and versioning
by crenz (Priest) on Apr 15, 2003 at 22:08 UTC | |
by BrowserUk (Patriarch) on Apr 15, 2003 at 22:50 UTC | |
by P0w3rK!d (Pilgrim) on Apr 16, 2003 at 14:41 UTC | |
|
Re: How to handle Cross-platform Perl, modules, and versioning
by Abigail-II (Bishop) on Apr 15, 2003 at 22:03 UTC | |
by BrowserUk (Patriarch) on Apr 15, 2003 at 22:28 UTC | |
|
Re: Re: Re: Re: How to handle Cross-platform Perl, modules, and versioning
by P0w3rK!d (Pilgrim) on Apr 16, 2003 at 14:34 UTC |