in reply to Re^2: Program for Windows and Unix
in thread Program for Windows and Unix
The problem is that the use Win32::NetResource is being executed at compile-time, while the condition is tested later, at runtime.
See CountZero's reply for a way around it: the module "if".
(Also, the string "aix" would need to be quoted... —> always use strict; )
Update: another way would be to use require (which is being executed at runtime):
unless ( $^O eq "aix" ) { require Win32::NetResource; Win32::NetResource->import(); # if you want any imports }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Program for Windows and Unix
by DrHyde (Prior) on Feb 27, 2009 at 10:51 UTC | |
|
Re^4: Program for Windows and Unix
by Richi (Initiate) on Feb 27, 2009 at 08:21 UTC | |
by ig (Vicar) on Feb 28, 2009 at 05:18 UTC |