in reply to Re^3: How to execute succcessful this Perl script in Linux, window and solaris?
in thread How to execute succcessful this Perl script in Linux, window and solaris?
That does the trick.
# Module.pm package Module; INIT { print("ok\n"); } 1;
>perl -we "use Module" ok >perl -we "require Module if $^O =~ /Win/" Too late to run INIT block at Module.pm line 3. >perl -we "eval 'use Module' if $^O =~ /Win/" Too late to run INIT block at Module.pm line 3. >perl -we "BEGIN { eval 'use Module' if $^O =~ /Win/ }" ok
Update: The if pragram is useful here:
>perl -we "use if $^O =~ /Win/, 'Module'" ok
|
---|